Skip to content

Instantly share code, notes, and snippets.

@orenfromberg
Created Aug 3, 2018
Embed
What would you like to do?
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