Author | tomtom |
Submission date | 2017-01-14 21:49:33.470401 |
Rating | 6769 |
Matches played | 397 |
Win rate | 64.74 |
Use rpsrunner.py to play unranked matches on your computer.
# drum v3
import random
if input == '':
history = ["R", "P", "S"]
else:
history.append(input)
what_beats = {"R": "P", "P": "S", "S": "R"}
base = ['R', 'P', 'S']
last_two = history[-2:]
for (a, b, next) in zip(history, history[1:], history[2:]):
if [a, b] == last_two:
base.append(next)
x = random.choice(base)
output = what_beats[x]