adamgilroy22 / python-hangman

Portfolio project 3 for Code Institute's diploma in software development
1 stars 4 forks source link

Leaderboard not printing most up to date version on game exit #12

Closed adamgilroy22 closed 2 years ago

adamgilroy22 commented 2 years ago

The leaderboard doesn't include the user if they make the top 10 and prints the version from the beginning of the game.

Tried fixing by adding importing time and adding time.sleep() to the function but that wasn't the issue. (https://github.com/adamgilroy22/python-hangman/commit/0d8cf2121f3dcaca91ca89cf5fb268d90b4f144e)

image image image

adamgilroy22 commented 2 years ago

Fixed by creating a new updated_leaderboard variable after the user has been added to the leaderboard and printing that if the user makes the top 10. Previously it was taking the leaderboard declared when the program started which didn't account for the user being added if their score got them in the top 10. Commit: https://github.com/adamgilroy22/python-hangman/commit/57d09940d35270f11d8ac204b3dc4dafa8c0d02c image