Author | AntiDog |
Submission date | 2018-08-07 10:08:30.712860 |
Rating | 2792 |
Matches played | 278 |
Win rate | 25.18 |
Use rpsrunner.py to play unranked matches on your computer.
import random
moves = {"S":"P","P":"R","R":"P"}
output = random.choice(["R","P","S"])
if input is None or input == "":
output = random.choice(["R","P","S"])
else:
if (len(input)+random.choice([0,1,2])) % 3 == 0:
output = random.choice(["R","P","S"])
else:
last = input[-1] if isinstance(input, list) else input
output = moves[last]