strategy_name = "winning move 2 times ago"
                    
import random
def move(my_history, their_history):
  if (len(my_history) < 2):
    return "s"
  return findPreviousWinner(my_history, their_history)
    
def findPreviousWinner(my_history, their_history):
  if (my_history[-2] == "r" and their_history[-2] == "p"):
    winner = "p"
  elif (my_history[-2] == "r" and their_history[-2] == "s"):
    winner = "r"
  elif (my_history[-2] == "r" and their_history[-2] == "r"):
    winner = "p"
  elif (my_history[-2] == "p" and their_history[-2] == "p"):
    winner = "s"
  elif (my_history[-2] == "p" and their_history[-2] == "s"):
    winner = "s"
  elif (my_history[-2] == "p" and their_history[-2] == "r"):
    winner = "p"
  elif (my_history[-2] == "s" and their_history[-2] == "p"):
    winner = "s"
  elif (my_history[-2] == "s" and their_history[-2] == "s"):
    winner = "r"
  elif (my_history[-2] == "s" and their_history[-2] == "r"):
    winner = "r"
  return winner

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: