关键词 > CSSE2310/CSSE7231

CSSE2310/CSSE7231 — Semester 2, 2022 Assignment 1

发布时间:2022-08-25

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CSSE2310/CSSE7231 — Semester 2, 2022

Assignment 1 (version 1)

Introduction

The goal of this assignment is to give you practice at  C programming.   You will be building on this abil-

ity  in  the  remainder  of the  course  (and  subsequent  programming  assignments  will  be  more  difficult  than this one).   You are to create a program  (called wordle-helper) which helps users play the Wordle game (www.nytimes.com/games/wordle/).   More details are provided below but you may wish to play the game to gain a practical understanding of how it operates.  The assignment will also test your ability to code to a particular programming style guide, and to use a revision control system appropriately.

Student Conduct

This is an individual assignment. You should feel free to discuss general aspects of C programming and the assignment specification with fellow students, including on the discussion forum. In general, questions like “How should the program behave if〈this happens)?”  would be safe, if they are seeking clarification on the specification.

You must not actively help (or seek help from) other students or other people with the actual design, structure and/or coding of your assignment solution. It is cheating to look at another student’s assignment code and it is cheating to allow your code to be seen or shared in printed or electronic form by others . All submitted code will be subject to automated checks for plagiarism and collusion. If we detect plagiarism or collusion, formal misconduct actions will be initiated against you, and those you cheated with. That’s right, if you share your code with a friend, even inadvertently, then both of you are in trouble.  Do not post your code to a public place such as the course discussion forum or a public code repository, and do not allow others to access your computer you must keep your code secure.

You must follow the following code referencing rules for all code committed to your SVN repository (not just the version that you submit):

Code Origin

Usage/Referencing

Code provided to you in writing this semester by CSSE2310/7231 teaching staff (e.g. code hosted on Black- board, posted on the discussion forum, or shown in class).

May be used freely without reference.  (You must be able to point to the source if queried about it.)

Code you have personally written this semester for CSSE2310/7231 (e.g. code written for A1 reused in A3)

May be used freely without reference.    (This assumes that no reference was required for the original use.)

Code examples found in man pages on moss .

May be used provided the source of the code is              referenced in a comment adjacent to that code.  (Code you have taken inspiration from must not be directly  copied or just converted from one programming             language to another.)

Code you have personally written in a previous enrolment

in this course or in another ITEE course and where that

code has not been shared or published.

Code  (in any programming language) that you have taken inspiration from but have not copied .

Other code includes: code provided by teaching staonly in a previous oering of this course (e.g. previous A1 solu- tion); code from websites; code from textbooks; any code written by someone else, or partially written by someone else; and any code you have written that is available to other students.

May not be used. If the source of the code is referenced adjacent to the code then this will be considered code without academic merit  (not misconduct) and will be removed from your assignment prior to marking (which may cause compilation to fail and zero marks to be awarded). Copied code without adjacent referencing will be considered misconduct and action will be taken.


Uploading or otherwise providing the assignment specification or part of it to a third party including online tutorial and contract cheating websites is considered misconduct.  The university is aware of these sites and many cooperate with us in misconduct investigations.



The course coordinator reserves the right to conduct interviews with students about their submissions, for

the purposes of establishing genuine authorship.  If you write your own code, you have nothing to fear from this

process.  If you are not able to adequately explain your code or the design of your solution and/or be able to

make simple modications to it as requested at the interview, then your assignment mark will be scaled down

based on the level of understanding you are able to demonstrate.

In short -  Don’t  risk  it!  If you’re having trouble,  seek help early from a member of the teaching staff.

understand the statements on student misconduct in the course prole and on the school web-site: https:

//www.itee.uq.edu.au/itee-student-misconduct-including-plagiarism

Specication

Your program is to suggest a list of words that might be suitable for playing in a Wordle game, given some

constraints.  The length of the word may be set on the command line  (between 4 and 9 characters inclusive)

but defaults to  5 if no length is specied.   The constraints on the word might include particular letters that

have to be in particular locations in the word, particular letters that must be found somewhere in the word, or

particular letters that must not be found in the word.

Full details of the required behaviour are provided below.

Command Line Arguments

Your program (wordle-helper) is to accept command line arguments as follows:

./wordle-helper  [-alpha|-best]  [-len word- length ]  [-with letters ]  [-without letters ]  [pattern ]

In other words, your program should accept 0 to 8 arguments after the program name. The square brackets

([]) indicate optional arguments.  The pipe symbol (|) indicates a choice.  The italics indicate placeholders for

user-supplied arguments.                                                                                                                                                  Some examples of how the program might be run include the following1:

./wordle-helper

./wordle-helper  -alpha

./wordle-helper  -best

./wordle-helper  -len  6

./wordle-helper  -with  abB

./wordle-helper  -without  xyZ

./wordle-helper  R___E

./wordle-helper  -alpha  -len  6  -with  os  -without  Xyz  r_p__e

./wordle-helper  r_P__e  -alpha  -without  XyZ  -len  6  -with  OS

Arguments can be in any order, as shown in the last example, but handling such arguments will only be

assessed as part of advanced functionality see below.

The meaning of the arguments is as follows:

●  -alpha if specified, this argument indicates that the output words must be sorted in alphabetical order2 and all duplicates must be removed. If this option is specified, then the -best option must not be specified.

●  -best if specied, this argument indicates that the output words must be sorted in decreasing order of

likelihood (as determined by the provided guess_compare() function described later).  Words with the

same likelihood must be sorted alphabetically.  Duplicates must be removed.  If this option is specied,

then the -alpha option must not be specied.

●  -len if specied, this argument must be followed by an integer between 4 and 9 inclusive that indicates

the length of the word to be used.  If the argument is not specied, a default word length of 5 shall be

used.

-with if specied, this argument is followed by a set of letters that must be present in matching words.

Letters can be listed in any order and with any case  (i.e.   uppercase and/or lowercase).   If a letter is



listed more than once then it must be present at least that number of times in matching words.  The set of letters may be empty which is the same as not specifying the -with argument.  All matching is case-independent e.g. an A’ or a’ in this set will match an A’ or a’ in the word.

●  -without if specified, this argument is followed by a set of letters that must not be present in matching words.  Letters may be listed more than once but this has the same effect as listing them once.  Letters may be listed in any order or with any case. The set of letters may be empty which is the same as not specifying the -without argument. All matching is case-independent e.g. an A’ or a’ in this set means that neither A’ nor a’ should be present in the word.

pattern if specified, this argument must be a string of the same length of words to be matched.  The string must contain only letters (any case) and underscores.  Words must match the pattern i.e.  must contain letters in the same position as letters that are present in the pattern, and any letter may match an underscore. A pattern of the right length consisting only of underscores is the same as not specifying a pattern (i.e. everything of the right length is a match). All matching is case independent.

Prior to doing anything else, your program must check the command line arguments for validity.  If the program receives an invalid command line then it must print the message:

Usage:  wordle-helper  [-alpha|-best]  [-len  len]  [-with  letters]  [-without  letters]  [pattern] to standard error (with a following newline), and exit with an exit status of 1.