Author | cfsh |
Submission date | 2017-09-09 11:20:34.874270 |
Rating | 3774 |
Matches played | 347 |
Win rate | 36.02 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if not input:
output = random.choice("RPS")
i = 0
a = {'R':0,'P':1,'S':2}
d = [0,0,0]
else:
i += 1
d[a[input]] += 1
if i % 30 < 15:
output = random.choice("RPS")
else:
if d[0] > d[1] and d[0] > d[2]:
output = 'P'
elif d[1] > d[2]:
output = 'S'
else:
output = 'R'