Author | ZedaM |
Submission date | 2017-05-13 15:20:38.363470 |
Rating | 3422 |
Matches played | 350 |
Win rate | 34.29 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if input == "":
beat={"R":"P","P":"S","S":"R","":""}
lastin="init"
lastout="init"
output=random.choice("RPS")
else:
if lastout==beat[beat[lastin]]:
output=beat[lastin]
elif lastout==beat[lastin]:
output=beat[lastout]
else:
output=random.choice("RPS")
lastin=input
lastout=output