This program has been disqualified.
Author | AntiDog |
Submission date | 2018-08-08 12:55:59.349030 |
Rating | 5000 |
Matches played | 0 |
Win rate | 0 |
import random
#pick_by_winrate
output = ""
if input == "":
output = "P"
oponentmoves = ""
wins = {}
else:
def beats(x,y):
if x == "R":
if y == "S": return True
if x == "P":
if y == "R": return True
if x == "S":
if y == "P": return True
return False
if last != "" and input != "":
if beats(last, input):
if lastIn+last in wins:
wins[lastIn+last] += 1
else:
wins[lastIn+last] = 1
#if beats(input, last):
# if lastIn+last in wins:
# wins[lastIn+last] -= 1
# else:
# wins[lastIn+last] = -1
r = 0
p = 0
s = 0
for w in wins:
if w[0] == input:
if w[1] == "R":
r += wins[w]
if w[1] == "P":
p += wins[w]
if w[1] == "S":
s += wins[w]
if r > p and r > s and r >0:
output = "P"
elif p > s and p > r and p >0:
output = "S"
elif s > p and s > r and s >0:
output = "R"
if output == "":
output = random.choice(["R","P","S"])
lastIn = input
last = output