Author | austin&paulette |
Submission date | 2018-03-06 02:41:06.508030 |
Rating | 4850 |
Matches played | 317 |
Win rate | 49.21 |
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