Created
November 14, 2012 03:13
-
-
Save bobmurder/4070034 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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