Author | gafe |
Submission date | 2014-10-11 12:36:12.927579 |
Rating | 3851 |
Matches played | 572 |
Win rate | 41.96 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if input == "":
output = random.choice(["R","P","S"])
lastinput=""
if input == "R" :
output = random.choice(["P","S"])
if input == "P" :
output= random.choice(["S","P"])
if input == "S" :
output=random.choice(["S","R"])
if lastinput == input:
if lastinput == "R":
output=random.choice(["S","P"])
elif lastinput == "S":
output=random.choice(["R","S"])
elif lastinput == "P":
output=random.choice(["P","R"])
lastinput=input
if random.choice([1,2,3]) == 1:
output=random.choice(["P","R"])