Author | rdococ |
Submission date | 2015-03-28 12:30:09.312825 |
Rating | 4687 |
Matches played | 527 |
Win rate | 47.06 |
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]) % len(history)]
if guess == "R":
output = "P"
elif guess == "S":
output = "R"
elif guess == "P":
output = "S"