Author | Jacob |
Submission date | 2020-01-31 19:51:35.759138 |
Rating | 2679 |
Matches played | 203 |
Win rate | 25.62 |
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 = "P"
else:
output = "S"
elif input == "P":
if lastChoice == "R": # I lost
output = "S"
else:
output = "R"
else: # input == "S"
if lastChoice == "P": # I lost
output = "R"
else:
output = "P"