Created
August 3, 2018 20:20
-
-
Save orenfromberg/9fe3283f5e86b3b193f4a1c672293533 to your computer and use it in GitHub Desktop.
friday coding challenge
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 bin(num) | |
num === 1 ? "1" : num === 0 ? "0" : "#{bin(num/2)}#{bin(num%2)}" | |
end | |
(1..64).each { |x| puts bin(x) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment