CommonWithLess2

Authorntsp
Submission date2011-06-09 09:30:09.065897
Rating6096
Matches played5320
Win rate58.57

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

Source code:

import random

if input == "": # initialize variables for the first round
    moves = []
    beat = "R"
    output = "S"
    round = 1
    next_r = 3
else:
    moves.append(input)

    random.shuffle(moves)
    beat = moves[0]
    if beat == "R":
        output = "P"
    elif beat == "P":
        output = "S"
    else:
        output = "R"
    
    if round == next_r:
        if output  == "R":
            output = "P"
        elif output  == "P":
            output = "S"
        else:
            output = "R"
        
    round += 1
    next_r += random.choice([8,9,10,11,12])