Author | Taslem |
Submission date | 2013-10-01 22:19:46.637900 |
Rating | 3269 |
Matches played | 658 |
Win rate | 29.79 |
Use rpsrunner.py to play unranked matches on your computer.
#Switchy is broken!
def shiftUp(x):
if x == "R":
return "P"
if x == "P":
return "S"
return "R"
def shiftDown(x):
if x == "R":
return "S"
if x == "P":
return "R"
return "P"
def c(x,y):
if x == y:
return "tie"
if shiftUp(y) == x:
return "win"
return "lose"
if input == "":
output = "R"
last = "R"
else:
if input == last:
output = shiftUp(input)
elif input == shiftUp(last):
output = input
else:
output = shiftDown(input)
last = output