Skip to content
Snippets Groups Projects
Commit 5cca54c5 authored by PAZAKOU THEODORA's avatar PAZAKOU THEODORA
Browse files

Upload New File

parent e966587d
Branches
No related merge requests found
# Word Guessing Game
This Python program is a simple word-guessing game where the player tries to guess a randomly selected 5-letter word within six attempts. The game provides feedback after each guess to help the player improve their subsequent guesses.
## How the Game Works
- After each guess, the game displays in the user's guess:
- **Correct letters in the correct position** as **uppercase**.
- **Correct letters in the wrong position** as **lowercase**.
- **Incorrect letters** are displayed separately.
## Key Functions
- `read_file(path: str)`: Reads a file and returns all 5-letter words.
- `choix()`: Randomly selects a word from the wordlist.
- `normalisation_accents(mot: str)`: Replaces accented characters with non-accented equivalents.
- `verif()`: Prompts the user for a valid 5-letter word.
- `jeu()`: Manages the game loop, feedback, and attempts.
## How to Play
1. The game begins by selecting a random word from a lexicon.
2. The player has six attempts to guess the word using the feedback provided.
3. The game ends when the player either guesses the word, runs out of attempts, or quits.
```
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment