This is my first time posting and using this site, sorry if this isn't the best way to ask. I have tried researching myself and looking for answers on this forum but each display i find is either a different language to my own or has a different issue. The issue I'm having is the game runs in terminal just as i would like except when it comes to a tie it doesn't register a tie and just begins a new game "choose your option or type quit to exit" on the next line. I am using Thonny as my editor and have followed the debugging procedure and it appears it just 'skips' the tie command. how can i fix this or is there some information or documentation you could point me towards to help me understand my issue. Thank-you
#rock, paper, scissors
import random, sys
wins = 0
losses = 0
ties = 0
print('Let\'s play a game')
print('rock. paper. scissors')
while True:
print('choose your option or type quit to exit')
print('%s wins, %s losses, %s ties'%(wins, losses, ties))
while True:
playeroption = input()
if playeroption == 'quit':
sys.exit() # Quit the program.
if playeroption == 'rock' or playeroption == 'paper' or playeroption == 'scissors':
break # Break out of the player input loop.
randomNumber = random.randint(0,2) #selecting computer options
if randomNumber == 0:
AIoption = 'Rock'
elif randomNumber == 1:
AIoption = 'Scissors'
elif randomNumber == 2:
AIoption = 'Paper'
if playeroption == AIoption: #player vs computer outcomes
print('draw, i choose ' + str( AIoption) +'!')
ties = ties + 1
continue
elif AIoption == 'Paper' and playeroption == 'rock':
print('better luck next time i choose ' + ( AIoption))
losses = losses + 1
continue
elif AIoption == 'Rock' and playeroption == 'scissors':
print('better luck next time i choose ' + str(AIoption))
losses = losses + 1
continue
elif AIoption == 'Scissors' and playeroption == 'paper':
print('better luck next time i choose ' + str(AIoption))
losses = losses + 1
continue
elif AIoption == 'Paper' and playeroption == 'scissors':
print('you win human. I choose ' + ( AIoption))
wins = wins + 1
continue
elif AIoption == 'Rock' and playeroption == 'paper':
print('you win human. I choose ' + str(AIoption))
wins = wins + 1
continue
elif AIoption == 'Scissors' and playeroption == 'rock':
print('you win human. I choose ' + str(AIoption))
wins = wins + 1
continue