Limited Weighted Random

AuthorVitali
Submission date2013-10-08 18:56:44.310403
Rating6128
Matches played658
Win rate57.9

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

Source code:

import random

if input == "":
    selection_list = ["R"]*10 + ["P"] * 10 + ["S"] * 10 #list limited to 30 elements
    random.shuffle(selection_list)
elif input == "R":
        selection_list.pop(0)
	selection_list += ["P"]
elif input == "P":
        selection_list.pop(0)
	selection_list += ["S"]
elif input == "S":
        selection_list.pop(0)
	selection_list += ["R"]

output  = random.choice(selection_list)