din

Authording
Submission date2017-12-14 06:21:59.381090
Rating4954
Matches played317
Win rate48.9

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

Source code:

import random


if input == "":
	moves=""
def count_substring(str, sub):
    if len(str) == 0:
        return 0
    if str[0:len(sub)] == (sub):
        return 1 + count_substring(str[1:], sub)
    else:
        return 0 + count_substring(str[1:], sub)


rockcount=0
papercount=0
scissorscount=0
last_2= moves[-2:]

if rockcount > papercount and rockcount > scissorscount:
	output = "P"

elif papercount > scissorscount and papercount > rockcount:
	output = "S"

elif scissorscount > papercount and scissorscount > rockcount:
    ouput = "R"
else:
	output = random.choice(["R", "P", "S"])

rockcount=0
papercount=0
scissorscount=0
last_3= moves[-3:]

if rockcount > papercount and rockcount > scissorscount:
	output = "P"

elif papercount > scissorscount and papercount > rockcount:
	output = "S"

elif scissorscount > papercount and scissorscount > rockcount:
    ouput = "R"
else:
	output = random.choice(["R", "P", "S"])

rockcount=0
papercount=0
scissorscount=0
last_4= moves[-4:]

if rockcount > papercount and rockcount > scissorscount:
	output = "P"

elif papercount > scissorscount and papercount > rockcount:
	output = "S"

elif scissorscount > papercount and scissorscount > rockcount:
    ouput = "R"
else:
	output = random.choice(["R", "P", "S"])

moves = moves + input