Author | Saheb |
Submission date | 2014-10-12 12:07:25.808317 |
Rating | 4331 |
Matches played | 546 |
Win rate | 42.49 |
Use rpsrunner.py to play unranked matches on your computer.
if input == "": # initialize variables for the first round
lastMove = ""
elif input == "R":
lastMove = "R"
elif input == "P":
lastMove = "P"
elif input == "S":
lastMove = "S"
if lastMove == "R":
output = "P" # paper beats rock
elif lastMove == "P":
output = "S" # scissors beats paper
else:
output = "R" # rock beats scissors