Author | strangepool |
Submission date | 2013-10-02 13:24:08.349780 |
Rating | 3240 |
Matches played | 648 |
Win rate | 32.72 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if not input:
counter = dict()
counter['R'] = counter['P'] = counter['S'] = 0
else:
counter[input] += 1
pool = [letter for letter in 'RPS' if counter[letter] == max(counter.values())]
crystal_ball = pool[random.randrange(len(pool))]
output = 'RPS'[('RPS'.index(crystal_ball) + 1) % 3]