bz2_compression

This program has been disqualified.


AuthorToblich
Submission date2016-04-05 09:06:28.780199
Rating3416
Matches played248
Win rate32.26

Source code:

from random import choice
from bz2 import compress

if input == "":
	anteriores = ""
	output = choice(["R", "P", "S"])
else:
	anteriores += input
	r = len(compress(anteriores + "R"))
	p = len(compress(anteriores + "P"))
	s = len(compress(anteriores + "S"))
	if r < p and r < s:	# Shorter length means higher probability
		output = "P"	# Paper beats Rock
	elif p < s:
		output = "S"	# Scissors beats Paper
	else:
		output = "R"	# Rock beats Scissors