Author | RKMMA |
Submission date | 2019-06-08 21:34:30.139198 |
Rating | 1925 |
Matches played | 225 |
Win rate | 20.89 |
Use rpsrunner.py to play unranked matches on your computer.
rockCount = paperCount = scissorsCount = 333
counter = 0
p = 0
def getProbability(keyCount,Counter):
return round((keyCount)/(1000-Counter),2)
if input == "": # initialize variables for the first round
counter += 1
output = "S"
elif(input == "R"):
p = getProbability(rockCount,counter)
rockCount -= 1
if(p > 0.5):
output = "P"
else:
output = "S"
elif(input == "P"):
p = getProbability(paperCount,counter)
paperCount -= 1
if(p > 0.5):
output = "S"
else:
output = "R"
elif(input == "S"):
p = getProbability(scissorsCount,counter)
scissorsCount -= 1
if(p > 0.5):
output = "R"
else:
output = "P"
else:
output = "S"