Replay

This program has been disqualified.


Authorntsp
Submission date2011-06-09 11:30:08.833418
Rating5746
Matches played4577
Win rate58.64

Source code:

import random

if input == "": # initialize variables for the first round
    moves = ["S"]
    beat = "R"
    output = random.choice(["R","P","S"])
    round = 0
    next_r = 3

else:
    moves.append(input)
    random.shuffle(moves)
    beat = moves[round]
    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([2,3,4])