As soon as I press "Run Module," a shell window opens with absolutely no errors, but also seems as if nothing is running. I don't have any idea why nothing is happening, but I'm guessing some of my code in the block at the bottom is very scuffed. The game is RPS-7, or Rock Paper Scissors with 7 options. I require some assistance on what to troubleshoot, as there seems to be no problem but there obviously is (the game doesn't actually run, it's just a useless shell). Here's the code, and here's to my first question of many.
import random
def game(choice):
options = ["Rock", "Paper", "Scissors", "Sponge", "Air", "Water", "Fire"]
bot = random.choice(options)
if choice == "Rock" and bot == "Scissors":
print ("Rock crushes scissors, you win!")
elif choice == "Rock" and bot == "Fire":
print ("Rock pounds out fire, you win!")
elif choice == "Rock" and bot == "Sponge":
print ("Rock crushes sponge, you win!")
elif choice == "Rock" and bot == "Paper":
print ("Paper covers rock, you lose..")
elif choice == "Rock" and bot == "Water":
print ("Water erodes rock, you lose..")
elif choice == "Rock" and bot == "Air":
print ("Air erodes rock, you lose..")
elif choice == "Rock" and bot == "Rock":
print ("Rock tries to pound rock but fails, it's a tie!")
elif choice == "Paper" and bot == "Rock":
print ("Paper covers rock, you win!")
elif choice == "Paper" and bot == "Water":
print ("Paper floats on the water, you win!")
elif choice == "Paper" and bot == "Air":
print ("Paper fans the air, you win!")
elif choice == "Paper" and bot == "Scissors":
print ("Paper gets cut by the scissors, you lose..")
elif choice == "Paper" and bot == "Fire":
print ("Paper gets burned by the fire, you lose..")
elif choice == "Paper" and bot == "Sponge":
print ("Paper gets soaked by the sponge, you lose..")
elif choice == "Paper" and bot == "Paper":
print ("Paper tries to cover paper but fails, it's a tie!")
elif choice == "Scissors" and bot == "Paper":
print ("Scissors cuts paper, you win!")
elif choice == "Scissors" and bot == "Air":
print ("Scissors swishes through air, you win!")
elif choice == "Scissors" and bot == "Sponge":
print ("Scissors cuts sponge, you win!")
elif choice == "Scissors" and bot == "Rock":
print ("Scissors gets crushed by rock, you lose..")
elif choice == "Scissors" and bot == "Fire":
print ("Scissors gets melted by scissors, you lose..")
elif choice == "Scissors" and bot == "Water":
print ("Scissors gets eroded by water, you lose..")
elif choice == "Scissors" and bot == "Scissors":
print ("Scissors tries to cut scissors but fails, it's a tie!")
elif choice == "Fire" and bot == "Scissors":
print ("Fire melts scissors, you win!")
elif choice == "Fire" and bot == "Paper":
print ("Fire burns paper, you win!")
elif choice == "Fire" and bot == "Sponge":
print ("Fire burns sponge, you win!")
elif choice == "Fire" and bot == "Rock":
print ("Fire gets pounded out by rock, you lose..")
elif choice == "Fire" and bot == "Air":
print ("Fire gets blown out by air, you lose..")
elif choice == "Fire" and bot == "Water":
print ("Fire gets put out by water, you lose..")
elif choice == "Fire" and bot == "Fire":
print ("Fire tries to burn fire but fails and creates a bigger fire, creating the biggest brushfire known to man. Therefore, it's a tie!")
elif choice == "Sponge" and bot == "Air":
print ("Sponge uses air pockets, you win!")
elif choice == "Sponge" and bot == "Paper":
print ("Sponge soaks paper, you win!")
elif choice == "Sponge" and bot == "Water":
print ("Sponge absorbs water, you win!")
elif choice == "Sponge" and bot == "Rock":
print ("Sponge gets crushed out by rock, you lose..")
elif choice == "Sponge" and bot == "Fire":
print ("Sponge gets burnt by fire, you lose..")
elif choice == "Sponge" and bot == "Scissors":
print ("Sponge gets cut by scissors, you lose..")
elif choice == "Sponge" and bot == "Sponge":
print ("Sponge tries to absorb sponge but fails and solves the world's water problem, however, it's a tie!")
elif choice == "Water" and bot == "Rock":
print ("Water erodes rock, you win!")
elif choice == "Water" and bot == "Fire":
print ("Water puts out fire, you win!")
elif choice == "Water" and bot == "Scissors":
print ("Water rusts scissors, you win!")
elif choice == "Water" and bot == "Sponge":
print ("Water gets absorbed by sponge, you lose..")
elif choice == "Water" and bot == "Air":
print ("Water gets evaporated by air, you lose..")
elif choice == "Water" and bot == "Paper":
print ("Water gets floated on by paper, you lose..")
elif choice == "Water" and bot == "Water":
print ("Water tries to put out water, but fails, creating a large tsunami that wipes out San Francisco. This seems oddly familliar to a song. It's a tie!")
elif choice == "Air" and bot == "Fire":
print ("Air blows out fire, you win!")
elif choice == "Air" and bot == "Rock":
print ("Air erodes rock, you win!")
elif choice == "Air" and bot == "Water":
print ("Air evaporates water, you win!")
elif choice == "Air" and bot == "Paper":
print ("Air gets fanned by paper, you lose..")
elif choice == "Air" and bot == "Scissors":
print ("Scissors swish through air, you lose..")
elif choice == "Air" and bot == "Sponge":
print ("Sponges use air pockets, you lose..")
elif choice == "Air" and bot == "Air":
print ("Air tries to blow out air, fails, and creates a tornado. It's a tie!")
def again(x):
while True:
if x == "y":
game(raw_input("Rock, Paper, Scissors, Sponge, Air, Water, or Fire?"))
again(raw_input("Play RPS - 7 again? y / n."))
else:
print ("Goodbye.")
break
break
game(raw_input("Rock, Paper, Scissors, Sponge, Air, Water, or Fire?"))
again(raw_input("Play RPS - 7 again? y / n."))
What happens when I run the code: