Created
July 30, 2012 17:46
-
-
Save koriroys/3208652 to your computer and use it in GitHub Desktop.
Binary patterns
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
MAX = 64 | |
zero_fill = MAX.to_s(2).size | |
[*0..MAX].each do |num| | |
puts "%#{zero_fill}d" % num.to_s(2) + " - #{num}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment