Sequence Test2

AuthorAntiDog
Submission date2018-08-07 13:00:58.854600
Rating3347
Matches played272
Win rate31.62

Use rpsrunner.py to play unranked matches on your computer.

Source code:

if input == "":
	output = "P"
	oponentmoves = ""
else:
	r = 0
	p = 0
	s = 0
	oponentmoves += input
	for i in range(2,len(oponentmoves)):
			searchsequence = oponentmoves[:i]
			nextresults = input.split(searchsequence)
			for res in nextresults:
				if res[0] == "R":
					r += 1
				if res[0] == "P":
					p += 1
				if res[0] == "S":
					s += 1
	if r >= p and r >= s:
		output = "R"
	elif p >= s and p >= r:
		output = "P"
	else:
		output = "S"