Ask coding questions

← Back to all posts
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
mkhoi (199)

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
MATTHEWBECHTEL (122)

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

xolyon (1)

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

xolyon (1)

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

MATTHEWBECHTEL (122)

Lol you tagged yourself. @xolyon