When I made this game, I divide the process into 3 part below:
-
Get the word that will be guessed by player
I get the words from github repository simply by put the link of the txt file insidegetWords1.py
and it will be opened by urllib. Finally, the words saved as a list. You can see the implementation in getWords file. -
The Flow of the game correspond to the rules
I made flowchart to map all condition where the player got wrong or true while guessed a letter and win or lose at the end of the game. You can see the flowchart here or you can see the detail of the game here. -
Chance visualization
I also used visualization which exists in github repository. Same as before, I used the urllib module to get the file and saved it asvisualLives.py
.
References: