Guest User

Untitled

a guest
Aug 10th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #!/usr/bin/env python3-with-choice
  2.  
  3. '''Pseudocode for solving infinite hat problem without hearing'''
  4.  
  5. import random
  6. import zfc
  7.  
  8. def guess_one(p, other_hats):
  9. # TODO: implement your algorithm here
  10. return 0
  11.  
  12. def hats_except_one(p, hats):
  13. return hats.difference([(p, 0), (p, 1)])
  14.  
  15. prisoners = input()
  16. hats = zfc.replace(lambda p: (p, random.choice([0, 1])), prisoners)
  17. guess = zfc.replace(lambda p: (p, guess_one(p, hats_except_one(p, hats))), prisoners)
  18.  
  19. assert zfc.isfinite(hats - guess)
Add Comment
Please, Sign In to add comment