Fixed Geometry Turbocharger 2

This program has been disqualified.


Authordllu
Submission date2011-05-25 18:43:20.016241
Rating4558
Matches played4422
Win rate48.62

Source code:

import random

lastmatch=0

if not input:
	urmoves=""
	movedifferences=[]
	output = random.choice(['R','P','S'])
else:
	output = random.choice(['R','P','S'])
	urmoves+=input
	if input==loutput:
		movedifferences.append(0)
	elif input=={'R':'P', 'P':'S', 'S':'R'}[loutput]:
		movedifferences.append(1)
	else:
		movedifferences.append(2)
	for i in range(len(urmoves)-1,21,-1):
		match=0
		j=1
		while movedifferences[i-j]==movedifferences[len(urmoves)-j]:
			match+=1
			if match>lastmatch:
				lastmatch=match
				if match>20:
					output=urmoves[i]
					break
			j+=1
			
		if match>20:
			break
	
	output =  {'R':'P', 'P':'S', 'S':'R'}[output]

loutput=output