Author | Michael |
Submission date | 2018-03-22 20:12:35.417550 |
Rating | 3419 |
Matches played | 299 |
Win rate | 35.79 |
Use rpsrunner.py to play unranked matches on your computer.
if input == "": # initialize variables for the first round
lastMove = "R"
output = "R"
elif (input == "R" and lastMove == "R"):
output = "P"
lastMove = "P"
elif (input == "R" and lastMove == "P"):
output = "S"
lastMove = "S"
elif (input == "R" and lastMove == "S"):
output = "P"
lastMove = "P"
elif (input == "P" and lastMove == "R"):
output = "S"
lastMove = "S"
elif (input == "P" and lastMove == "P"):
output = "S"
lastMove = "S"
elif (input == "P" and lastMove == "S"):
output = "R"
lastMove = "R"
elif (input == "S" and lastMove == "R"):
output = "P"
lastMove = "P"
elif (input == "S" and lastMove == "P"):
output = "R"
lastMove = "R"
elif (input == "S" and lastMove == "S"):
output = "R"
lastMove = "R"