Skip to content

Instantly share code, notes, and snippets.

@bobmurder
Created November 14, 2012 03:13
Show Gist options
  • Save bobmurder/4070034 to your computer and use it in GitHub Desktop.
Save bobmurder/4070034 to your computer and use it in GitHub Desktop.
import random
from collections import defaultdict
def update(input):
counts[input] += 1
def play():
rcounts = {str(v): k for k, v in counts}
return rcounts[max([str(val) for val in counts.values())]]
if input == '':
counts = defaultdict(int)
output = 'R'
else:
update(input)
pick = play()
output = pick
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment