Author | rand0m |
Submission date | 2019-11-24 20:27:34.765865 |
Rating | 5977 |
Matches played | 210 |
Win rate | 59.05 |
Use rpsrunner.py to play unranked matches on your computer.
import random
if input == "":
ycards = {"R": 0, "P": 0, "S": 0}
count = 0
else:
ycards[input] += 1
count += 1
if count <= 300:
output = random.choice(["R", "P", "S"])
rs = ycards["R"]
ps = ycards["P"]
ss = ycards["S"]
rint = random.randint(0, count)
if rint < rs:
output = "P"
elif rint < (rs + ps):
output = "S"
else:
output = "R"