Author | ahsdflaksjdflas |
Submission date | 2018-03-06 02:46:27.279300 |
Rating | 5345 |
Matches played | 312 |
Win rate | 53.53 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if input == "": # initialize variables for the first round
rockCount = 0
paperCount = 0
scissorsCount = 0
if random.choice(['A','P'])=='A':
output = random.choice(["R","P","S"]) # rock beats scissors
elif input == "R":
rockCount += 1
elif input == "P":
paperCount += 1
elif input == "S":
scissorsCount += 1
if rockCount > paperCount and rockCount > scissorsCount:
output = "P" # paper beats rock
elif paperCount > scissorsCount:
output = "S" # scissors beats paper
else:
output = random.choice(["R","P","S"]) # rock beats scissors
output = random.choice(["R","P","S"]) # rock beats scissors
#asdfasdfsadfas