Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -17,7 +17,6 @@ while True:
print('yay you win!')
elif rules[human] == computer: # if what beats the human's choice is the computer's choice...
print('the computer beat you... :(')
else:
print("it's a tie!")
else: print("it's a tie!")
else: print("that's not a valid choice")

View file

@ -0,0 +1,10 @@
from random import randint
hands = ['rock', 'scissors', 'paper']; judge = ['its a tie!', 'the computer beat you... :(', 'yay you win!']
while True:
try:
YOU = hands.index(input('Choose your weapon: ')) # YOU = hands.index(raw_input('Choose your weapon: ')) If you use Python2.7
except ValueError:
break
NPC = randint(0, 2)
print('The computer played ' + hands[NPC] + '; ' + judge[YOU-NPC])