Author | Pablo |
Submission date | 2017-02-12 09:25:50.991305 |
Rating | 2234 |
Matches played | 380 |
Win rate | 26.05 |
Use rpsrunner.py to play unranked matches on your computer.
if input == "":
lastR = lastP = lastS = 0
elif input == "R":
lastR = 0
lastP += 1
lastS += 1
elif input == "P":
lastP = 0
lastR += 1
lastS += 1
elif input == "S":
lastS = 0
lastR += 1
lastP += 1
if lastR > lastP and lastR > lastS:
output = "R"
elif lastS > lastP:
output = "S"
else:
output = "P"