Author | ARST |
Submission date | 2017-07-07 20:45:11.390170 |
Rating | 6007 |
Matches played | 347 |
Win rate | 59.65 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if input == "":
inputs = []
counters = {
'R': 'P',
'P': 'S',
'S': 'R'
}
else:
inputs.append(input)
if inputs:
output = counters[random.choice(inputs)]
else:
output = random.choice(["R","P","S"])