This program has been disqualified.
Author | dllu |
Submission date | 2011-05-25 18:43:20.016241 |
Rating | 4558 |
Matches played | 4422 |
Win rate | 48.62 |
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