My3rdPythonProgram

AuthorCarsten Drossel
Submission date2011-06-20 12:44:42.033442
Rating2639
Matches played5007
Win rate25.84

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

Source code:

import random
if input == "":
  history = ""
  output = random.choice(["R","P","S"])
else:
  history += input
  tobeat = history[random.randint(0, len(input)-1)]
  if tobeat == "R":
	output = "P"
  elif tobeat == "P":
	output = "S"
  elif tobeat == "S":
	output = "R"