Author | human |
Submission date | 2019-10-16 09:06:37.204860 |
Rating | 6082 |
Matches played | 223 |
Win rate | 58.74 |
Use rpsrunner.py to play unranked matches on your computer.
import random
previous = input
if previous == "":
pattern = "RPS"
def beat(choise):
if choise == "R":
return "P"
elif choise == "P":
return "S"
else:
return "R"
if previous != "":
pattern += previous
output = beat(random.choice(pattern))