Created
February 20, 2015 18:03
-
-
Save azmenak/747db8f2fcf2a3b7eb55 to your computer and use it in GitHub Desktop.
RPS Sample
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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