Skip to content

Instantly share code, notes, and snippets.

@orenfromberg
Created August 3, 2018 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orenfromberg/9fe3283f5e86b3b193f4a1c672293533 to your computer and use it in GitHub Desktop.
Save orenfromberg/9fe3283f5e86b3b193f4a1c672293533 to your computer and use it in GitHub Desktop.
friday coding challenge
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