Author | kAworu |
Submission date | 2019-05-14 12:31:30.334522 |
Rating | 6161 |
Matches played | 253 |
Win rate | 59.68 |
Use rpsrunner.py to play unranked matches on your computer.
#!/usr/bin/env python
import random
# keep track of the opponent choice history, pick one of them at random and
# beat it.
if input == "":
history = []
output = random.choice("RPS")
else:
history.append(input)
output = {"S": "R", "R": "P", "P": "S"}[random.choice(history)]