From 980c3a584fd44ff5858ecf3cb2e305a739c1d07f Mon Sep 17 00:00:00 2001 From: tobia Date: Thu, 15 Dec 2022 12:03:06 +0100 Subject: [PATCH] fixed many bugs --- main.py | 13 ++++++++++++- settings.txt | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 8229969..acbaf33 100644 --- a/main.py +++ b/main.py @@ -41,7 +41,9 @@ def update_coins(coins): settings_file = open("settings.txt", "r+").readlines() os.remove("settings.txt") f = open('settings.txt', 'a') - f.write(f"money:{coins}\n") + data = settings_file + data[0] = f"money:{coins}\n" + f.writelines(data) def settings(coins): @@ -120,6 +122,8 @@ def game_guess_the_number(): print(f"You only have {coins} coins") print(Fore.RESET) game_guess_the_number() + if coins <0: + game_guess_the_number() except Exception: print(Fore.RED) print("Please enter a valid number") @@ -271,6 +275,11 @@ def game_black_jack(): print(f"You only have {coins} coins") print(Fore.RESET) game_black_jack() + input() + if bet < 0: + print("please enter a valid number") + input() + game_black_jack() except Exception: print(Fore.RED) print("Please enter a valid number") @@ -366,6 +375,8 @@ def game_jackpot(): f"or end the game if you raise it you have a 40% chance to double the multiplier 0 -> 2 -> 4 -> ...\n" f"If you are unlucky all your coins are away\n" f"Note if you end with a x0 multiplier your coins are also gone") + input() + game_jackpot() print(Fore.RESET) elif task == 1: print(Fore.YELLOW) diff --git a/settings.txt b/settings.txt index 157c514..f1c9361 100644 --- a/settings.txt +++ b/settings.txt @@ -1,2 +1,2 @@ money:100 -version:v2.0 +version:v2.1 \ No newline at end of file