Author | Kyle Miller |
Submission date | 2011-07-29 15:38:45.983048 |
Rating | 3105 |
Matches played | 3861 |
Win rate | 33.41 |
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 :
last_choice = current_choice
if current_choice == last_choice :
current_choice = random.choice(moves)
num_times = 0
num_times += 1
output = current_choice