Author | Kyle Miller |
Submission date | 2011-07-28 23:32:38.067080 |
Rating | 3588 |
Matches played | 3909 |
Win rate | 32.9 |
Use rpsrunner.py to play unranked matches on your computer.
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 :
current_choice = random.choice(moves)
num_times = 0
num_times += 1
output = current_choice