#Variables:
aiMoves=random.randint(0, 2)
p1Move=input('Player 1, whats your move?(Rock, Paper, or Scissors): ').lower
#game structure
#AI moves to strings
if aiMoves==0: aiMoves='rock'
elif aiMoves==1: aiMoves='scissors'
elif aiMoves==2: aiMoves='paper'
#points definitions
#Rock for Player
if p1Move=='rock' and aiMoves=='paper': print('AI played Paper, you lose !')
elif p1Move=='rock' and aiMoves=='scissors': print('AI played Scissors, you win !')
elif p1Move=='rock' and aiMoves=='rock': print('AI played rock, game is tied')
#Paper for Player
if p1Move=='paper' and aiMoves=='paper': print('AI played Paper, game is tied')
elif p1Move=='paper' and aiMoves=='scissors': print('AI played Scissors, you lose !')
elif p1Move=='paper' and aiMoves=='rock': print('AI played rock, you won !')
#Scissors for Player
if p1Move=='scissors' and aiMoves=='paper': print('AI played Paper, you won !')
elif p1Move=='scissors' and aiMoves=='scissors': print('AI played Scissors, game is tied')
elif p1Move=='scissors' and aiMoves=='rock': print('AI played rock, you lose !')
The code works fine, it asks the player what their move is, but after that, it simply shuts down and returns 0 errors.
Aucun commentaire:
Enregistrer un commentaire