python AI代写,AI作业代写,AI编程代写,AI代写
AI代写,AI作业代写,python AI代写,AI编程代写
1 Getting Started
To start, download a1.zip from Blackboard and extract the contents. The a1.zip folder contains all the
necessary les to start this assignment. Some support code has been provided to assist with implementing
the tasks. You will be required to implement your assignment in a1.zip.
The other provided le is a1 support.py, which contains some code to help you implement your assign-
ment. You are not compelled to use this le to implement your assignment but it is strongly recommended.
Do not make changes to the a1 support.py le. The only le that you should submit is a1.zip. It could cause
unexpected errors submit more than one le or if you made changes to the a1 support.py le as well.
Note: The functionality of your assignment will be marked by automated tests. This means that the
output of each function, as well as the output of your overall program, must be exact to the specications
outlined below in the Implementation section. This includes whitespace, grammar, etc. If you add your
own messages throughout the game, you will likely fail most of the automated tests. Some sample tests will
be provided to give you an idea of whether your output diers from the expected output. These tests are
not necessarily the complete set of tests that will be used in marking, so if you pass all sample tests you are
not necessarily guaranteed to achieve full functionality marks. However, if you do not pass all sample tests,
you are guaranteed not to achieve full functionality marks.
2 Concepts
At the start of the game the user selects a diculty, and then a word is chosen at random based on that
diculty. The word length will depend on the diculty selected by the user; either \FIXED" (meaning the
word will be exactly eight letters long), or \ARBITRARY" (meaning the word will be anywhere between
six to eight letters long). The goal of the game is for the player to guess that word through a series of guesses
of \subwords". The player will have a dierent number of guesses (with dierent subwords to guess; see
GUESS INDEX TUPLE), depending on the diculty selection. If the player chooses the \FIXED" di-
culty, the word must be selected at random from the WORDS FIXED.txt le. If the player chooses the
\ARBITRARY" diculty, the word must be selected at random from theWORDS ARBITRARY.txt
le.
At program startup, the user is asked to specify one of three actions:
2.1 If the user species \FIXED"
The game randomly selects an eight-letter word from the WORDS.txt le and the correct guess sequence
from the GUESS INDEX TUPLE tuple.
Each vowel guessed in the correct position gets 14 points. Each consonant guessed in the correct posi-
tion gets 12 points. Each letter guessed correctly but in the wrong position within the substring gets 5
points. You can assume that the words do not contain repeated letters and all guesses are lowercase letters.
2.2 If the user species \ARBITRARY"
The game randomly selects a word from the WORDS ARBITRARY.txt le and the correct guess se-
quence from the GUESS INDEX TUPLE tuple.
The scoring system is the same as for the "FIXED" word length.
2.3 Guessing procedure
2.3.1 For an eight-letter word
The user will be prompted to guess the word, step by step. The guessing procedure involves 8 steps, where
the guess slices will depend on the GUESS INDEX TUPLE. At each of the 7 rst steps the user guesses a
subsection of the word and receives feedback (their score) for that guess. The nal 8th step involves guessing
the whole word. After the 8th guess, the user is informed of whether they `won' (i.e. guessed the word
correctly) or `lost' (in which case they are told what the word was). If, at any stage, the player enters a
guess that is of the incorrect length then the game should repeatedly prompt for the correct word length
until the player enters a guess that matches the length of the substring to be guessed in that step.
