daily pastebin goal
46%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 56 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  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)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top