A Python implementation of the popular word game Wordle, featuring a graphical interface using the turtle module. The game reads words from a text file and provides a grid-based interface for guessing.
- A grid-based Wordle game built using
turtlegraphics. - Customizable word list loaded from a text file (
words.txt). - Feedback on each guess:
- Green: Correct letter in the correct position.
- Yellow: Correct letter in the wrong position.
- Gray: Letter not in the word.
- Python 3.x
turtlemodule (comes pre-installed with Python)- A text file named
words.txtcontaining the word list.
-
Clone the repository:
git clone <REPO_URL> cd <REPO_DIRECTORY>
-
Ensure
Wordle.pyandwords.txtare in the same folder. -
Run the game:
python Wordle.py
-
Enter your guesses directly in the pop-up input box.
-
Follow the on-screen instructions to complete the game.
-
Grid Setup:
The game sets up a 5x5 grid and prompts you to guess a word. -
Enter Your Guess:
Input a valid 5-letter word. Feedback will be displayed based on your guess:- Green: Correct letter and position.
- Yellow: Correct letter but wrong position.
- Gray: Letter not in the word.
-
Win or Lose:
- If you guess the word in 5 attempts or fewer, you win!
- Otherwise, the game ends with the correct word revealed.
You can modify the words.txt file to include your own list of 5-letter words. Ensure:
- All words have exactly 5 letters.
- The file does not contain any special characters, numbers, or blank lines.
To test the game:
- Add a valid word list to
words.txt. - Run the script:
python Wordle.py
- Verify the gameplay functionality, including grid drawing and feedback.
-
Initialize the repository:
git init
-
Add files to the repository:
git add Wordle.py words.txt README.md .gitignore LICENSE
-
Commit changes:
git commit -m "Initial commit: Wordle game implementation" -
Create a remote repository on GitHub and push:
git remote add origin <REPO_URL> git branch -M main git push -u origin main
- The game automatically validates guesses for correct length and word validity.
words.txtmust contain at least one valid 5-letter word, or the game will not start.
This project is open-source and available under the MIT License.