Skip to content

Add Cup Game #285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Cup Game/README.md
Original file line number Diff line number Diff line change
@@ -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
34 changes: 34 additions & 0 deletions Cup Game/main.py
Original file line number Diff line number Diff line change
@@ -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()