Author | Sema4 |
Submission date | 2011-06-09 01:14:25.037491 |
Rating | 3198 |
Matches played | 5588 |
Win rate | 29.6 |
Use rpsrunner.py to play unranked matches on your computer.
import random
gambits = [
['R','R','R'],
['P','P','P'],
['P','S','R'],
['R','S','P'],
['R','P','P'],
['P','S','S'],
['P','S','P'],
['S','S','S']
]
if not input:
gambit = gambits[random.randint(0,len(gambits)-1)]
curround = 0
output = gambit[curround]
curround += 1
if curround > 2:
gambit = gambits[random.randint(0,len(gambits)-1)]
curround = 0