Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Roulette, limited to only placing bets on Black/Red
- import random
- current_money = float(initial_bankroll)
- bet_amount = 0
- def main():
- initial_bankroll = bankroll()
- print("Your bankroll is", "$" + str(initial_bankroll))
- game_mode = type_of_game()
- print()
- print()
- if game_mode == "regular":
- play_regular()
- elif game_mode == "algorithm":
- play_algorithm()
- else:
- print("Invalid game mode selection")
- print()
- print("Current bankroll: $", str(current_money))
- def determine_winning(selection):
- random_number = random.randrange(1,39)
- if selection == "red":
- selection = random_number <= 17
- if selection:
- outcome = "You have won by landing on Red", str(random_number) + "/38)"
- elif selection == 38:
- outcome = "You have lost by landing on the Green 0"
- else:
- outcome = "You have lost by landing on Black", str(random_number) + "/38"
- return outcome
- if selection == "black":
- selection = 17<random_number<38
- if selection:
- outcome = "You have lost by landing on Red", str(random_number) + "/38)"
- elif selection == 38:
- outcome = "You have lost by landing on the Green 0"
- else:
- outcome = "You have won by landing on Black", str(random_number) + "/38"
- return outcome
- def current_bank_roll():
- return current_money
- def number_of_games_played():
- pass
- def play_regular():
- print()
- print("!" * len("Game mode is Regular"))
- print("Game mode is Regular")
- print("!" * len("Game mode is Regular"))
- print()
- print()
- bet_amount = float(input("How much do you want to bet? :"))
- print("You have bet: $" + str(bet_amount))
- print()
- color_picked = pick_a_color()
- print()
- print("!" * (len("You have selected: ") + len(color_picked)))
- print("You have selected:", color_picked[0].upper() + color_picked[1:])
- print("!" * (len("You have selected: ") + len(color_picked)))
- print()
- print("(Red are all numbers from 1 through and including 17)")
- print("(Black are all numbers from 18 through and including 37)")
- print("(The Green zero is the number 38)")
- print()
- print("!!!!!",determine_winning(color_picked),"!!!!!")
- current_money = current_money - bet_amount
- def play_algorithm():
- print("Game mode is Algorithm")
- def pick_a_color():
- option = input("Enter a color. (Enter Red or Black): ")
- option = option.lower().strip()
- return option
- def change_color():
- pass
- def color_win_streak():
- pass
- def bankroll():
- return float(input("Enter bankroll amount: "))
- def type_of_game():
- print()
- option = input("Would you like to play a regular game of Roulette, or play using the color changing algorithm? (Enter Regular/Algorithm): ")
- option = option.lower().strip()
- return option
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement