Mini_Python_Projects
Mini_Python_Projects copied to clipboard
In WordLadder: Adding valid cache for word validation, word list file existence check, and viewing high scores
Issues in Game WordLadder
-
Repeated API calls in
is_valid_word()cause slow gameplay and potential rate-limit errors also cause create a delay after inputting the word. -
Program crashes when
wordList.txtis missing or misplaced. -
No option to view high scores even though they are saved in
highscores.jsonthey can be shown to player in run time.
Solutions
- Implement a cache dictionary (
valid_cache) to store API results and avoid repeated lookups also saves times. - Add a file existence check using
os.path.exists()before openingwordList.txtto prevent crashes. - Introduce a "View High Scores" menu option that reads and displays results from
highscores.jsonfor better user experience.
Please assign this task to me, i want to contribute and fix the issues :)