same as test 2 but loses instead

This program has been disqualified.


Authorrfw
Submission date2011-05-22 08:39:13.993772
Rating552
Matches played163
Win rate5.52

Source code:

import random

lastmatch=0

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

mymoves+=output