Anolizer2

AuthorKia Kroas
Submission date2011-05-21 12:01:49.907702
Rating4240
Matches played7384
Win rate41.08

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

Source code:

import random
if input == "":
	rock = paper = scissor = beat = 0
	play = 0
	last_output = 'R'


result = {'R':'P', 'P':'S', 'S':'R'}[last_output]
if result == input:
	beat += 1

if input == "R":
	rock += 1
	output = "P"
elif input == "P":
	paper += 1
	output = "S"
elif input == "S":
	scissor += 1
	output = "R"
else:
	output = 'P'

play += 1

if play >= 100:
	if beat > play/2 + 20:
		{'R':'P', 'P':'S', 'S':'R'}[output]
else:
	output = random.choice(["R", "P", "S"])

last_output = output