Author | rdococ |
Submission date | 2015-03-29 11:57:37.326791 |
Rating | 5665 |
Matches played | 515 |
Win rate | 53.2 |
Use rpsrunner.py to play unranked matches on your computer.
import random
output = random.choice(["R", "S", "P"])
if input == "":
history = []
guess = ""
else:
history = [input] + history
guess = history[random.choice([3, 4, 5, 6, 7, 8, 9]) % len(history)]
if guess == "R":
output = "P"
elif guess == "S":
output = "R"
elif guess == "P":
output = "S"