obstinate v1

AuthorKyle Miller
Submission date2011-07-28 23:31:21.062219
Rating1930
Matches played3760
Win rate14.92

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

Source code:

import random

if not input :
    moves = ["R", "P", "S"]
    did_lose = {"R":"P", "P":"S", "S":"R"}
    current_choice = random.choice(moves)
    num_times = 1
    output = current_choice
else :
    if did_lose[input] == current_choice :
        current_choice = random.choice(moves)
        num_times = 0
    num_times += 1
    output = current_choice