rndbeatng

Authorpyfex
Submission date2011-07-27 11:44:40.799933
Rating5867
Matches played3911
Win rate61.65

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

Source code:

import random

if input == "":
    rps = list('RPS')
    points = [0] * 3
    output = random.choice(rps)
    total = 0
else:
    oidx = rps.index(input)
    points[(oidx+1)%3] += 2
    points[oidx] += 1
    total += 3
    r = random.randint(0,total-1)
    output = ""
    if r < points[0]:
        output = 'R'
    elif r < points[0] + points[1]:
        output = 'P'
    elif r < points[0] + points[1] + points[2]:
        output = 'S'