a guest Aug 10th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- #!/usr/bin/env python3-with-choice
- '''Pseudocode for solving infinite hat problem without hearing'''
- import random
- import zfc
- def guess_one(p, other_hats):
- # TODO: implement your algorithm here
- return 0
- def hats_except_one(p, hats):
- return hats.difference([(p, 0), (p, 1)])
- prisoners = input()
- hats = zfc.replace(lambda p: (p, random.choice([0, 1])), prisoners)
- guess = zfc.replace(lambda p: (p, guess_one(p, hats_except_one(p, hats))), prisoners)
- assert zfc.isfinite(hats - guess)
RAW Paste Data