Author | rdococ |
Submission date | 2015-03-28 12:25:31.933620 |
Rating | 5345 |
Matches played | 506 |
Win rate | 52.77 |
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, 6, 9, 12]) % len(history)]
if guess == "R":
output = "P"
elif guess == "S":
output = "R"
elif guess == "P":
output = "S"