Better Shuffle

AuthorVitali
Submission date2019-02-28 23:28:16.992963
Rating6167
Matches played241
Win rate63.49

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

Source code:

import random

if input == "":
    selection_list = ["R"] * 22 + ["P"] * 22 + ["S"] * 22
else:
    random.shuffle(selection_list)
    if 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)