Centrifugal Bumblepuppy 11.2

This program has been disqualified.


Authordllu
Submission date2011-06-23 18:46:25.147366
Rating7838
Matches played2163
Win rate75.54

Source code:

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

import random
numPre = 72
numMeta = 6
if not input:
	limits = [50,25,12,6]
	beat={'R':'P','P':'S','S':'R'}
	moves=['','','']
	pScore=[[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
	rofl=random.randint(10,20)
	lofl=random.randint(150,200)
	threat = [0,0,0]
	outcome = 0
else:
	oldoutcome = outcome
	outcome = (beat[input]==output2) - (input==beat[output2])
	threat[oldoutcome + 1] *= 0.955
	threat[oldoutcome + 1] -= 0.042*outcome
	for i in range(numPre):
		pScore[0][i]=0.84*pScore[0][i]+((input==p[i])-(input==beat[beat[p[i]]]))*3 #Win +3; draw +0; lose -3 or *0 with probability 0.51. All *0.8
		pScore[1][i]=0.84*pScore[1][i]+((output==p[i])-(output==beat[beat[p[i]]]))*3 #Beat meta 0
		if input==beat[beat[p[i]]] and random.random<0.5:
			pScore[0][i]=0
		if output==beat[beat[p[i]]] and random.random<0.5:
			pScore[1][i]=0
	for i in range(numMeta):
		mScore[i]=0.9*mScore[i]+(input==m[i])-(input==beat[beat[m[i]]])
		if input==beat[beat[m[i]]] and random.random<0.5:
			mScore[i]=0
	moves[0]+=centrifuge[input+output]
	moves[1]+=input		
	moves[2]+=output
	length+=1
	for z in range(4):
		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:
				if random.random<0.5:
					i = moves[y].rfind(moves[y][length-j:length],0,length-1)
				elif random.random<0.5:
					i = moves[y].rfind(moves[y][length-j:length],0,length-1)
					i2 = moves[y].rfind(moves[y][length-j:length],0,i)
					if i2!=-1:
						i=i2
				else:
					i = moves[y].find(moves[y][length-j:length],0,length-1)
				p[0+2*y+6*z] = moves[1][j+i] 
				p[1+2*y+6*z] = beat[moves[2][j+i]] 
	
	for i in range(24,24*3):
		p[i]=beat[beat[p[i-24]]]
		
	for i in range(0,2,2):
		m[i]=       p[pScore[i  ].index(max(pScore[i  ]))]
		m[i+1]=beat[p[pScore[i+1].index(max(pScore[i+1]))]]
	for i in range(2,6):
		m[i]=beat[beat[m[i-2]]]
output2 = output = beat[m[mScore.index(max(mScore))]]
if length%lofl<rofl or random.random() < 0.4*threat[outcome+1]+0.1:
	output=random.choice("RPS")