obstinate v1.21

AuthorKyle Miller
Submission date2011-07-29 16:42:44.294833
Rating3618
Matches played3795
Win rate35.36

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[current_choice] == input :
        last_choice = current_choice
        while current_choice == last_choice :
            current_choice = random.choice(moves)
        num_times = 0
    num_times += 1
    output = current_choice