diff --git a/poc_hawai.py b/poc_hawai.py index 5d9c2d2..e515dd1 100644 --- a/poc_hawai.py +++ b/poc_hawai.py @@ -1,6 +1,8 @@ import os import csv import random +import time + from rich.console import Console from rich.markdown import Markdown @@ -77,9 +79,10 @@ def _wait_user_answ(answer): return False else: # ===> if only one possible answer result = input("\nWhat is your choice : ") + if result.lower() == "q" or result.lower() == "quit": return 3 - if result in answer["ANSWER"]: + if result in answer["ANSWER"] and len(result) != 0: return True else: return False @@ -118,6 +121,7 @@ def main(): _display_question(csv_list[count]) # Check if correct answer result = _wait_user_answ(csv_list[count]) + if result == 3: # quit! get_out_while = True elif result: # right answer! @@ -128,5 +132,6 @@ def main(): # End of while _stats(csv_list, player) + if __name__ == "__main__": main()