Uniform I

AuthorValence
Submission date2016-02-07 02:45:44.647896
Rating5511
Matches played441
Win rate53.51

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

Source code:

import random

MOVES = ["R","P","S"]

if not input:
    moveCounts = [0, 0, 0]
    moves = -1

moves += 1;
output = random.choice(MOVES)

if input:
    probabilities = []
    for i in moveCounts:
        probabilities.append((1 - float(i) / moves) / 2)

    r = random.random()
    sum = 0
    for i in range(0, 3):
        sum += probabilities[i]
        if r <= sum:
            output = MOVES[i]
            break

moveCounts[MOVES.index(output)] += 1