This program has been disqualified.
Author | lut-ze |
Submission date | 2011-06-11 01:48:04.302885 |
Rating | 3122 |
Matches played | 2279 |
Win rate | 30.06 |
import random
if input == "":
history = ""
longest_substr = 0
output = random.choice(["R","P","S"])
else:
history += input
output = do_history()
if len(history) > 2 :
output = do_history()
else:
output = random.choice(["R","P","S"])
def do_history():
next = "R"
if (len(history) > 100):
max_len = 100
else:
max_len = len(history)
for i in range(1,max_len) :
substr = history[-i:]
if history.count(substr)> 1:
next = history[history.index(substr)+len(substr)]
return next