# Centrifugal Bumblepuppy 8

This program has been disqualified.

 Author dllu Submission date 2011-06-22 22:29:56.622901 Rating 7663 Matches played 122 Win rate 77.87

## Source code:

``````#                         WoofWoofWoof
#                     Woof            Woof
#                Woof                      Woof
#              Woof                          Woof
#             Woof  Centrifugal Bumble-puppy  Woof
#              Woof                          Woof
#                Woof                      Woof
#                     Woof            Woof
#                         WoofWoofWoof

import random

numPre = 120
numMeta = 18
if not input:
limits = [30,11,6]
beat={'R':'P','P':'S','S':'R'}
moves=['','','']
pScore=[[3]*numPre,[3]*numPre,[3]*numPre,[3]*numPre,[3]*numPre,[3]*numPre]
centrifuge={'RP':'a','PS':'b','SR':'c','PR':'d','SP':'e','RS':'f','RR':'g','PP':'h','SS':'i'}
length=0
p=[random.choice("RPS")]*numPre
m=[random.choice("RPS")]*numMeta
mScore=[3]*numMeta
lol=3
helicase=[0]*6
else:
for i in range(numPre):
pScore[0][i]=0.8*pScore[0][i]+((input==p[i])-(input==beat[beat[p[i]]]))*3
pScore[1][i]=0.8*pScore[1][i]+((output==p[i])-(output==beat[beat[p[i]]]))*3
if input==beat[beat[p[i]]] and random.random<0.51:
pScore[0][i]=0
if output==beat[beat[p[i]]] and random.random<0.51:
pScore[1][i]=0
pScore[2][i]=0.87*pScore[0][i]+(input==p[i])*3.3-(input==beat[p[i]])*0.9-(input==beat[beat[p[i]]])*3
pScore[3][i]=0.87*pScore[1][i]+(output==p[i])*3.3-(output==beat[p[i]])*0.9-(output==beat[beat[p[i]]])*3
pScore[4][i]=(pScore[2][i]+(input==p[i])*3)*(1-(input==beat[beat[p[i]]]))
pScore[5][i]=(pScore[3][i]+(output==p[i])*3)*(1-(output==beat[beat[p[i]]]))
for i in range(numMeta):
mScore[i]=0.957*mScore[i]+(input==m[i])-(input==beat[beat[m[i]]])
if input==beat[beat[m[i]]] and random.random<0.51:
mScore[i]=0
moves[0]+=centrifuge[input+output]
moves[1]+=input
moves[2]+=output
length+=1
for z in range(3):
limit = min([length,limits[z]])
for y in range(3):
j=limit
while j>=1 and not moves[y][length-j:length] in moves[y][0:length-1]:
j-=1
if j>=1:
i = moves[y].rfind(moves[y][length-j:length],0,length-1)
p[0+4*y+12*z] = moves[1][j+i]
p[1+4*y+12*z] = beat[moves[2][j+i]]
i = moves[y].find(moves[y][length-j:length],0,length-1)
p[2+4*y+12*z] = moves[1][j+i]
p[3+4*y+12*z] = beat[moves[2][j+i]]

i=moves[0].rfind(moves[0][length-j:length-1],0,length-2)
while i==-1:
j-=1
i=moves[0].rfind(moves[0][length-j:length-1],0,length-2)
if j<2:
break
if i==-1 or j+i>=length:
p[37]=p[36]=random.choice("RPS")
else:
p[37]=beat[moves[2][j+i]]
p[36]=moves[1][j+i]

helicase[0] = helicase[0]*0.95+{'R':0,'P':-0.1,'S':0.1}[output]
helicase[1] = helicase[1]*0.95+{'R':0.1,'P':0,'S':-0.1}[output]
helicase[2] = helicase[2]*0.95+{'R':-0.1,'P':0.1,'S':0}[output]
p[38] = {0:'R',1:'P',2:'S',3:'R',4:'P',5:'S'}[helicase.index(max(helicase[0:3]))]

helicase[3] = helicase[3]*0.95+{'R':0.1,'P':0,'S':-0.1}[input]
helicase[4] = helicase[4]*0.95+{'R':-0.1,'P':0.1,'S':0}[input]
helicase[5] = helicase[5]*0.95+{'R':0,'P':-0.1,'S':0.1}[input]
p[39] = {0:'R',1:'P',2:'S',3:'R',4:'P',5:'S'}[helicase.index(max(helicase[3:6]))]

for i in range(40,40*3):
p[i]=beat[beat[p[i-40]]] #Trying to second guess me?

m[0]=p[pScore[0].index(max(pScore[0]))]
m[1]=beat[p[pScore[1].index(max(pScore[1]))]]
m[2]=p[pScore[2].index(max(pScore[2]))]
m[3]=beat[p[pScore[3].index(max(pScore[3]))]]
for i in range(6,18):
m[i]=beat[m[i-6]]
output = beat[m[mScore.index(max(mScore))]]
if max(mScore)<lol or random.random<0.1 or random.randint(3,40)>length:
x=random.random()*sum(range(length,0,-1))
b=range(length,0,-1)
for i in range(length):
if x <= b[i]:
output=beat[moves[1][i]]
break
x -= b[i]
lol=0.98*max(mScore)``````