Author | mkg |
Submission date | 2017-12-04 17:18:21.815410 |
Rating | 2843 |
Matches played | 300 |
Win rate | 24.33 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if input == "":
rockCount = paperCount = scissorsCount = 0
opponentMoves = 0
n = opponentMoves
elif input == "R":
rockCount = 1
opponentMoves = 1
elif input == "P":
paperCount = 1
opponentMoves = 1
elif input == "S":
scissorsCount = 1
opponentMoves = 1
if rockCount > paperCount and rockCount > scissorsCount:
output = "P"
elif paperCount > scissorsCount and paperCount > rockCount:
output = "S"
else:
output = "R"