This program has been disqualified.
Author | trump |
Submission date | 2014-10-12 04:03:28.173165 |
Rating | 5412 |
Matches played | 1 |
Win rate | 100.0 |
import random
def get_move(hist):
n = min(80, len(hist)-1)
for k in range(n, 1, -1):
m = hist.rfind(hist[-k:], 0, -1)
if m != -1 :
return trump[hist[m+k]]
return random.choice('RPS')
if input == "":
trump = {'R': 'P', 'P': 'S', 'S': 'R'}
hist = ''
output = random.choice('RPS')
else:
hist += input
output = get_move(hist)