Author | Jacob |
Submission date | 2020-01-31 19:57:36.003380 |
Rating | 2985 |
Matches played | 204 |
Win rate | 29.41 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if input == "":
output = lastChoice = random.choice(["R", "P", "S"])
elif input == lastChoice:
output = random.choice(["R", "P", "S"])
elif input == "R":
if lastChoice == "S": # I lost
output = random.choice(["R", "P"])
else:
output = random.choice(["R", "S"])
elif input == "P":
if lastChoice == "R": # I lost
output = random.choice(["P", "S"])
else:
output = random.choice(["R", "P"])
else: # input == "S"
if lastChoice == "P": # I lost
output = random.choice(["R", "S"])
else:
output = random.choice(["P", "S"])