This program has been disqualified.
Author | EbTech |
Submission date | 2011-05-23 21:34:26.269210 |
Rating | 725 |
Matches played | 138 |
Win rate | 7.25 |
import math
if input == "":
wins = 0
matchHistory = ""
else:
if wins < 100:
wins += (4+{'R':0,'P':1,'S':2}[olast]-{'R':0,'P':1,'S':2}[input])%3 - 1
matchHistory += input
index = 0
limit = 50
heatR = heatP = heatS = 0
while index < len(matchHistory)-2:
index2 = index
index3 = len(matchHistory)-2
length = 0
while index2 >= 0:
if matchHistory[index2] != matchHistory[index3] or matchHistory[index2+1] != matchHistory[index3+1]:
break
index2 -= 2
index3 -= 2
length += 1
if length > limit:
break
predict = matchHistory[index+3]
energy = math.pow(length+1, math.log(length+1)+1)
if predict == 'R':
heatP -= energy
heatS += energy
elif predict == 'P':
heatS -= energy
heatR += energy
else:
heatR -= energy
heatP += energy
index += 2
if heatR > heatP and heatR > heatS:
output = "R"
elif heatP > heatS:
output = "P"
else:
output = "S"
if wins >= 100:
output = "R"
matchHistory += output
olast = output