From 7b718ed279aa9cd75b6dab53b3a651720645dd89 Mon Sep 17 00:00:00 2001 From: David Duirs <61534026+dduirs@users.noreply.github.com> Date: Tue, 9 Apr 2024 10:40:34 +0200 Subject: [PATCH] Update hangman.py suggestions to improve timer and hangman visuals --- hangman.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hangman.py b/hangman.py index a90aa37..4576def 100644 --- a/hangman.py +++ b/hangman.py @@ -94,7 +94,7 @@ def addSpaces(lettersOfWord): for letter in lettersOfWord: lettersSpaced += (str(letter) + ' ') return lettersSpaced - +# add progressive hangman visualisation def displayGameResult(lives): if lives == 0: print(f"\n YOU GOT HUNG! _________ ") @@ -114,7 +114,8 @@ def displayGameResult(lives): print(f" | / | ") print(f" _____ / \ ") -def printTimePlayed(): +# improve timer to display minutes and seconds + def printTimePlayed(): toc=time.perf_counter() print(f"\nYou've been playing for {toc - tic:0.0f} seconds\n")