Note
From v2.0.0, this code uses the Python curses
module for cleaner
command line printing. This is not available on Windows operating
systems. If you are using Windows, please use v1.1.0 instead.
A version of the newly popular game "Wordle" that is playable from the command line. It uses the same word lists as the official game! Lists found here and here.
The objective of the game is to guess the five-letter word correctly in 6 tries. After each guess, you will be told which of the letters are in the word and if they are in the correct spot or not.
To use, run the wordle.py
file as follows:
> python3 wordle.py
You can also choose to enable hard mode by adding the command
line argument -h
or -hardMode
. With hard mode enabled,
if a letter is marked yellow or green, you must use it in all
future guesses.
The output will update in place. Once the user quits the program, the output will be cleared from the screen.
Here is an example of a full playthrough of Wordle using the program, using regular mode, and then hard mode: