Author | AntiDog |
Submission date | 2018-08-07 10:10:08.027290 |
Rating | 4215 |
Matches played | 267 |
Win rate | 41.57 |
Use rpsrunner.py to play unranked matches on your computer.
import random
moves = {"S":"R","P":"S","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]