Author | asdfasdf |
Submission date | 2018-03-06 02:42:12.813540 |
Rating | 5112 |
Matches played | 328 |
Win rate | 52.74 |
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':
# 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
else:
output = random.choice(["R","P","S"]) # rock beats scissors