Author | david.werecat |
Submission date | 2013-02-08 15:02:05.389388 |
Rating | 6444 |
Matches played | 715 |
Win rate | 66.43 |
Use rpsrunner.py to play unranked matches on your computer.
if input == "":
last = ["R"] * 9
prev = "R"
ctx = 0
else:
last[ctx] = input
ctx = ((ctx * 3) + {"R":0,"P":1,"S":2}[prev]) % 9
output = prev = {"R":"P","P":"S","S":"R"}[last[ctx]]