Created
February 12, 2016 23:17
-
-
Save Magnap/0a81c5184b862e5ba221 to your computer and use it in GitHub Desktop.
Binary encoding "magic trick" card generator (http://nuit-blanche.blogspot.dk/2010/07/magic-trick.html)
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
rows n = iterate (go . go) (go (take n [0..])) where go = map (+n) | |
cards n = take n . map (take (2^(n-1)) . concat . g . (2^)) . take n $ [0..] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment