From f2d7a316c91623f621157bae938ccefebbaf4d0a Mon Sep 17 00:00:00 2001 From: Aidr0ne Date: Sat, 4 Jan 2025 09:53:46 +0000 Subject: [PATCH] Add Cup Game --- Cup Game/README.md | 13 +++++++++++++ Cup Game/main.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 Cup Game/README.md create mode 100644 Cup Game/main.py diff --git a/Cup Game/README.md b/Cup Game/README.md new file mode 100644 index 00000000..5166e0c2 --- /dev/null +++ b/Cup Game/README.md @@ -0,0 +1,13 @@ +# Cup Game + + +This Game Works by having you input a 'Wager' And your winning are mutiplied by the number in the selected cup + +In The 10 Cups there are: + +* 5x 0 +* 1x 1 +* 1x 2 +* 1x 3 +* 1x 4 +* 1x 5 diff --git a/Cup Game/main.py b/Cup Game/main.py new file mode 100644 index 00000000..2b715864 --- /dev/null +++ b/Cup Game/main.py @@ -0,0 +1,34 @@ +import random +import time + +def shuffle_cups(shuffle_max: int = 100) -> list[int]: + cups = [0, 0, 0, 0, 0, 1, 2, 3, 4, 5] + for i in range(shuffle_max): + cup = cups[0] + cups.remove(cups[0]) + cups.insert(random.randint(0, 8), cup) + + return cups + +money = 500 + +if __name__ == "__main__": + while True: + print(f"You Have {money} Balance") + print("Enter How Much you wish to Wage (Enter 0 if you wish to quit)") + wager = int(input(": ")) + cups = shuffle_cups() + if wager == 0: break + elif wager <= money: + print("Wager accepted!") + money -= wager + + c = int(input("Please enter a number from 1 to 10: ")) - 1 + print(f"You win {cups[c] * wager} !!!") + money += wager * cups[c] + print(f"You now have a balance of {money}") + input() + + else: + print("That Is not a valid amount Please Try Again") + input()