Author | rdococ |
Submission date | 2015-03-28 04:00:02.673966 |
Rating | 1309 |
Matches played | 517 |
Win rate | 13.93 |
Use rpsrunner.py to play unranked matches on your computer.
import random
output = random.choice(["R", "S", "P"])
if input == "":
a = ""
b = ""
else:
a = b
b = input
if a == b:
if b == "R":
output = "S"
elif b == "S":
output = "P"
elif b == "P":
output = "R"
elif b == "":
output = random.choice(["R", "S", "P"])
else:
if a == "R":
if b == "S":
output = "S"
elif b == "P":
output = "R"
elif a == "S":
if b == "R":
output = "S"
elif b == "P":
output = "P"
elif a == "P":
if b == "S":
output = "P"
elif b == "R":
output = "R"