Get the input from the user. Write a program that will handle getting the EXACTA bet, and the EXACTABOX bet as input from the user. Cheat, and by this I mean, show the results of the race to the user before they make their bets, that way they can cheat and win if they want. Keep track of your money as USD and assume you start out with 200 dollars. Put your logic into a loop so you can keep placing bets and running races and see your balance as you go.
Python - question down below
This is my code for a horse racing betting game
Code :
import random
def Readysetgo(horses):
shuffled = random.sample(horses,len(horses))
return shuffled
horses = [1,2,3,4]
ch=1
balance = 200
while(ch!=0):
print("Please select from the following options 1-6")
print("1. Place an exact bet")
print("2. Place an exactabox bet")
print("3. Place a trifectabet")
print("4. Please a trifectabox bet")
print("5. See your USD balance")
print("6. Exit")
ch = int(input())
if ch==1:
balance -= 10
shuffled = Readysetgo(horses)
print("Guess the exact winning order of the top two horses.")
x,y = input().split()
x = int(x)
y = int(y)
if x==shuffled[0] and y==shuffled[1]:
balance += 100
elif ch==2:
balance -= 5
shuffled = Readysetgo(horses)
print("Guess the top two horses in any order.")
x,y = input().split()
x = int(x)
y = int(y)
if (x==shuffled[0] and y==shuffled[1]) or (x==shuffled[1] and y==shuffled[0]):
balance += 50
elif ch==3:
balance -= 25
shuffled = Readysetgo(horses)
print("Guess the exact winning order of the top three horses.")
x,y,z = input().split()
x = int(x)
y = int(y)
z = int(z)
if (x==shuffled[0] and y==shuffled[1] and z==shuffled[2]):
balance += 200
elif ch==4:
balance -= 20
shuffled = Readysetgo(horses)
print("Guess the top three horses in any order.")
x = list(map(int,input().split()))
if (shuffled.sort()==x.sort()):
balance += 150
elif ch==5:
print("Your USD Balance is ",balance," USD.")
elif ch==6:
ch=0
else:
print("Invalid choice.. Please enter again")
print("Thanks for Playing...!")
Question: Need help to modify
Get the input from the user. Write a program that will handle getting the EXACTA bet, and the EXACTABOX bet as input from the user. Cheat, and by this I mean, show the results of the race to the user before they make their bets, that way they can cheat and win if they want. Keep track of your money as USD and assume you start out with 200 dollars. Put your logic into a loop so you can keep placing bets and running races and see your balance as you go.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images