Author | Henry |
Submission date | 2017-07-05 07:20:33.944850 |
Rating | 3811 |
Matches played | 328 |
Win rate | 33.84 |
Use rpsrunner.py to play unranked matches on your computer.
if input == "": # initialize variables for the first round
rockCount = paperCount = scissorsCount = 0
elif input == "R":
rockCount += 1
elif input == "P":
paperCount += 1
elif input == "S":
scissorsCount += 1
if rockCount > scissorsCount and rockCount > paperCount:
output = "P" # paper beats rock
elif paperCount > scissorsCount:
output = "S" # scissors beats paper
else:
output = "R" # rock beats scissors