TheGambit

AuthorSema4
Submission date2011-06-09 01:14:25.037491
Rating3198
Matches played5588
Win rate29.6

Use rpsrunner.py to play unranked matches on your computer.

Source code:

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