Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from random import choice
- patterns = {}
- lasthuman = 'tails'
- num = 5
- a = ['heads','tails']
- patterns['heads'] = ['heads']
- patterns['tails'] = ['tails']
- print 'Think of a number between 1 and 10'
- while num < 11:
- robo = choice(patterns[lasthuman])
- print "I guess",robo
- print "----------------------------------"
- human = str(raw_input('What did it land on > '))
- a.append(human)
- patterns[lasthuman].append(human)
- lasthuman = human
- """ Machine statistically guesses whether next toss will be heads or tails by choosing randomly from two list of previous results; if previous was head append result to head list etc """
Advertisement
Add Comment
Please, Sign In to add comment