Ask coding questions

← Back to all posts
1
My game wont run
xolyon (1)

earlir this worked , now however it has broken down i don't know why please help i have checked everything and i am planning to expand this.

https://repl.it/@xolyon/Rock-paper-scisors

Commentshotnewtop
1
mkhoi (178)

I think you haven't put the if/elif conditions for the player's move

# Do like this
if player_move == "r":
  # Your code for this
elif player_move == "p":
  # Your code for this
elif player_move == "s":
  # Your code for this

# Add an else and wrap this in a "while" condition 
# to let the player pick again if they got a typo
1
MATTHEWBECHTEL (121)

I’m no pro but I believe the error has occurred because you have not defined the variable named q.
@xolyon

1
xolyon (1)

@MATTHEWBECHTEL hmmm i am not sure i belive that if the input is q (for quit) it just means break the script

1
xolyon (1)

@xolyon edit my porgram then i and show me the corrected version

1
MATTHEWBECHTEL (121)

Lol you tagged yourself. @xolyon