Skip to content

Instantly share code, notes, and snippets.

@azmenak
Created February 20, 2015 18:03
Show Gist options
  • Save azmenak/747db8f2fcf2a3b7eb55 to your computer and use it in GitHub Desktop.
Save azmenak/747db8f2fcf2a3b7eb55 to your computer and use it in GitHub Desktop.
RPS Sample
import random
player = raw_input('RPS!: ')
RPS = ("rock", "paper", "scissors")
computer = RPS[random.randint(0,2)]
R = RPS[0]
P = RPS[1]
S = RPS[2]
if player == computer:
res = "TIE"
elif (player == R and computer == S) or (player == P and computer == R) or (player == S and computer == P):
res = "WIN"
else:
res = "LOSE"
print res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment