Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit b162ef7

Browse files
committed
updates the description according to Kais's suggestions
1 parent e966a4a commit b162ef7

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

exercises/final_exam/assignment/exercise.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Wordle in Python
22

33
Your task for the final assignment is to implement a [Wordle](https://en.wikipedia.org/wiki/Wordle)
4-
clone in Python. The basis for you version of Wordle is the file
4+
clone in Python. The basis for your version of Wordle is the file
55
`5_letter_words.txt` [[1]](https://www-cs-faculty.stanford.edu/~knuth/sgb.html).
66
It contains more than 5.700 five letter words. In order to build your
77
version of Wordle perform the following steps:
88

99
1. Implement a function `word_list()` that reads the `5_letter_words.txt` file and returns a list
1010
of the words in the file.
1111
1. Implement a function `random_word()` that takes a list of words as a parameter and returns a random word
12-
from this list. This random word is the one, the player of Wordle has to guess.
12+
from this list.
1313
1. Implement a function `is_real_word()` that takes two parameters, a guess and a word list and returns `True` if
1414
the word is in the word list and `False` otherwise.
1515
1. Implement a function `check_guess()`that takes two parameters. The first is the guessed word and the second is the
@@ -18,19 +18,19 @@ version of Wordle perform the following steps:
1818
- `O` for each character in the guess that is in the word but not at the correct position.
1919
- `_` for each character in the guess that is not part of the word.
2020
For example, `check_guess("birds", "words")` should return `__XXX`.
21-
- If a letter is used twice in the guess word and exists only once in the word to be found,
21+
- If a letter is used twice in the guessed word and exists only once in the word to be found,
2222
then only one letter in the return string is marked. In case one of the two letters is
23-
positioned correctly, then this letters is marked with an `X` in the return string.
23+
positioned correctly, then this letter is marked with an `X` in the return string.
2424
For example, `check_guess("carat", "train")` should return `_OO_O`.
2525
Another example, `check_guess("taunt", "train")` should return `XO_O_`
2626
1. Implement a function `next_guess()` that takes a word list as a parameter. The function asks the user
27-
for a guess converts the guess to lower case and checks if the guess is in the word list. If yes, the guess is returned.
28-
If not the function asks the user for another guess.
27+
for a guess, converts the guess to lower case and checks if the guess is in the word list. If this is the case,
28+
the guess is returned. Otherwise, the function asks the user for another guess.
2929
1. Implement a function `play()` that:
3030
- Uses the functions `word_list` and `random_word` to select a random 5 letter word.
3131
- Asks the user for a guess using the `next_guess` function.
3232
- Checks each guess using the `check_guess` function and shows the result to the user.
33-
- Checks if the users guessed the right word with six guesses or less. If yes the
33+
- Checks if the users guessed the right word with six guesses or less. If yes, the
3434
user wins and the function prints `You won!`. Otherwise the user loses and the function
3535
prints `You lost!` as well as `The word was:` followed by word the user had to find.
3636

@@ -65,4 +65,4 @@ And here is another example execution of the program:
6565
XXX_X
6666
Please enter a guess: these
6767
XXXXX
68-
You won!
68+
You won!

0 commit comments

Comments
 (0)