Russian Roulette Simulator Python
Russian Roulette Simulator Python
## IMPORTING ##
import random
import sys
## TITLE ##
new_game = input("|\ | | ____ ____ ----- /\ |\ | |\
/-----\ | | | |----- ------- ------- |-----" + "\n" +"| \ | | / /
| / \ | \ | | \ | | | | | | | |
|" + "\n" + "| | | | \ \ | / \ | \ | | | |
| | | | |_____ | | |_____" + "\n" + "| / | | \ \
| /------\ | \ | | / | | | | | | | |
|" + "\n" + "|\ \ / \ \ | / \ | \ | | \ |
| | | | | | | |" + "\n" + "| \ \_/ ___/ ____/
----- / \ | \| | \ \-----/ \____/ |_____ |----- | |
|----- " + "\n"+ "You start with $100, and your goal is to make it to
$100,000."+"\n"+"You can double your money by playing russian roulette, but if you
lose you lose everything." + "\n"*2 + "Press [ENTER] to play the game."+"\n") == ""
## MONEY AND ALIVENESS SETUP ##
money = 100
player_lives = True
## CHECKING ALL CONDITIONS NEEDED FOR PLAYING ##
while new_game and money < 100000 and player_lives:
print("You have $"+str(money))
chamber_filled = random.randint(1, 6)
input("You sit at the table, across from your enemy. "+"\n"+"Press [ENTER] to
flip a coin to see who goes first."+"\n") == "n"
flip = random.randint(1, 2)
if flip == 1:
p_turn = True
else:
p_turn = False
## OPPONENT ALIVENESS ##
opponent_lives = True
## GAME LOOP ##
while opponent_lives and player_lives:
if p_turn:
devmode = input("Your turn." +"\n"+ "Type anything to fire the gun. ")
== "devmode"
if devmode or chamber_filled > 1:
print("\n"+"You pull the trigger..."+"\n"+"...and the gun clicks.")
chamber_filled -= 1
elif chamber_filled <= 1:
print("/n"+"You pull the trigger... "+"\n"+"...and a party popper
goes off and kinda hurts your head."+"\n"+"YOU LOSE")
player_lives = False
else:
print("Opponent turn."+"\n"+"")
if chamber_filled <= 1:
print("\n"+"Your opponent pulls the trigger..."+"\n"+"...and a
party popper goes off from the gun!")
opponent_lives = False
else:
print("\n"+"Your opponent pulls the trigger... "+"\n"+"...and the
gun clicks.")
chamber_filled -= 1
p_turn = not p_turn
if player_lives:
money *= 2
print("/n"+"You end with $"+str(money)+"."+"\n"+"As everything ends, you realize
this was all just a dream and that the ACTUAL game is very different and school
appropriate.")
#if chamber_filled == 1:
# lose
#else:
# win
# chamber_filled -= 1