Author | pavankumarkasireddi |
Submission date | 2019-06-25 03:07:05.168538 |
Rating | 5885 |
Matches played | 236 |
Win rate | 56.78 |
Use rpsrunner.py to play unranked matches on your computer.
import random
# initializing variables for the first round
if input == "":
rockCount = 0
paperCount = 0
scissorsCount = 0
elif input == "R":
rockCount += 1
elif input == "P":
paperCount += 1
elif input == "S":
scissorsCount += 1
outputchoice = ['R', 'P', 'S']
for r in range(rockCount / 2):
outputchoice.append('P')
for p in range(paperCount / 2):
outputchoice.append('S')
for s in range(scissorsCount /2 ):
outputchoice.append('R')
random.shuffle(outputchoice)
if len(outputchoice) > random.randint(900, 1100):
outputchoice = ['S', 'P', 'R']
output = random.choice(outputchoice)