multi_algo_3

This program has been disqualified.


Authorjfp
Submission date2011-06-13 15:49:47.865841
Rating2039
Matches played8
Win rate25.0

Source code:

import random

if input == "":
  output = "S"
algo = random.choice(["a", "b", "c", "d"])
if  algo == "a":
  # Play randomly.
  output = random.choice(["S", "R", "P"])
elif algo == "b":
  # Play the move that would have won last time.
  if input == "R":
    output = "P"
  elif input == "P":
    output = "S"
  else:
    output = "R"
elif algo == "c":
  # Play the same move again.
    output = output
elif algo == "d":
  # Play the opponent's move.
  output = input