Author | Tim M |
Submission date | 2011-12-09 14:12:38.342656 |
Rating | 5819 |
Matches played | 802 |
Win rate | 55.86 |
Use rpsrunner.py to play unranked matches on your computer.
import random
import math
if input == "":
wR = random.randint(1,3)
wP = random.randint(1,3)
wS = random.randint(1,3)
elif input == "R":
wP += 1
elif input == "P":
wS += 1
elif input == "S":
wR += 1
while True:
t = random.randint(1,3)
x = random.uniform(0,500)
if t == 1:
if x < math.fabs(random.gauss(0,wR)):
output = "R"
break
elif t == 2:
if x < math.fabs(random.gauss(0,wP)):
output = "P"
break
elif t == 3:
if x < math.fabs(random.gauss(0,wS)):
output = "S"
break