Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Russian Roulette game made in python. The rules are simple: Each player has to press enter to pull the trigger
- # and the player that hits the chambers that contains the bullet, losses!
- # After the game is over the user has the option to restart the game.
- import random
- while True:
- chambers = input("Please enter the number of chambers (default = 6): ")
- if not chambers:
- chambers = 5
- elif not chambers.isdigit():
- quit("Invalid number of chambers!")
- fatal_bullet = random.randint(1, int(chambers))
- for x in range(1, int(chambers) + 1):
- input("Press enter to pull the trigger! ")
- if x == fatal_bullet:
- print("You just got served!")
- print("Game Over")
- break
- print("You will live to see another day")
- start_again = input("Do you want to start again? (y/n): ")
- if start_again and start_again.lower()[0] != "y":
- break
- # For more scripts: https://drive.google.com/drive/folders/1thBhACRzWCMbaPogfAbpaMTB4dZ32GTO?usp=drive_link
Advertisement
Advertisement