Created
March 12, 2016 06:28
-
-
Save vznvzn/04a99bbe15b33f4b0f66 to your computer and use it in GitHub Desktop.
This file contains 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
def expand(l) | |
l2 = [] | |
l.each \ | |
{ | |
|x| | |
l2 << '10' + x[1..-1] | |
l2 << '11' + x[1..-1] | |
} | |
return l2 | |
end | |
l = ['1'] | |
p(l) | |
5.times { l = expand(l); p(l) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment