pyrdle/README.md
2025-10-01 09:17:40 +01:00

91 lines
3.0 KiB
Markdown

# Python Wordle Game - Terminal Edition
A terminal-based implementation of Wordle using Python and ncurses.
## Requirements
- Python 3.6+
- ncurses library
## Files
- `pyrdle.py` - Main game implementation
- `pyrdle_words_[level].txt` - Tiered dictionaries of valid 5-letter words
## How to Run
```bash
$ poetry run python pyrdle.py --help (20361d14h4m)|*[main]
usage: pyrdle.py [-h] [--easy | --medium | --hard] [--common | --literary | --techy | --cultural | --full ]
[--wordlist FILE]
pyrdle Game - Guess the 5-letter word!
options:
-h, --help show this help message and exit
--easy Easy mode: common words only
--medium Medium mode: standard vocabulary
--hard Hard mode: includes obscure words
--common Common everyday words
--literary Literary and archaic terms
--techy Technical and scientific terms
--cultural Cultural and international terms
--full Full dictionary (all words)
--wordlist FILE Use custom word list file
Difficulty Levels:
--easy Common everyday words (default)
--medium Standard vocabulary including less common words
--hard Challenging words including archaic and technical terms
Word Categories:
--common Common English words (default)
--literary Literary and archaic terms
--techy Technical and scientific terms
--cultural Words from various cultures and languages
--full Complete dictionary with all words
Examples:
python3 pyrdle.py --easy
python3 pyrdle.py --techy
python3 pyrdle.py --hard --literary
```
## How to Play
1. The goal is to guess the secret 5-letter word within 6 attempts
2. Type your guess using the keyboard (A-Z letters)
3. Press Enter to submit your guess
4. After each guess, the color of the letters will change:
- **Green**: Letter is in the word and in the correct position
- **Yellow**: Letter is in the word but in the wrong position
- **Red**: Letter is NOT in the word (confirmed absent)
- **Gray/Dim**: Letter has not been used yet (shown on keyboard)
The keyboard at the bottom shows all letters with their current status,
making it easy to track which letters are still available for guessing.
## Controls
- **A-Z**: Type letters for your guess
- **Enter**: Submit your current guess
- **Backspace**: Delete the last letter
- **N**: Start a new game (when game is over)
- **Q** or **ESC**: Quit the game
- **Ctrl+C**: Force quit
## Adding More Words
To expand the word list, simply add more 5-letter words (one per line) to the appropriate file in the `wordlists` directory.
The game automatically filters for 5-letter words and converts them to uppercase.
## Troubleshooting
If colors don't display correctly:
- Ensure your terminal supports colors
- Try running with: `TERM=xterm-256color python3 wordle.py`
If the game doesn't fit your terminal:
- Resize your terminal window to at least 80x24 characters
- The game adapts to different terminal sizes but needs minimum space