Skip to content

Instantly share code, notes, and snippets.

@osyoyu
Created February 6, 2016 06:07
Show Gist options
  • Save osyoyu/f8ae4a46499b4c22e777 to your computer and use it in GitHub Desktop.
Save osyoyu/f8ae4a46499b4c22e777 to your computer and use it in GitHub Desktop.
bi_print
require "pry"
R = 2
def bi_print(num)
eval(num.gsub(";", ",")).map.with_index do |digit, i|
digit * (R ** i)
end.inject(&:+)
end
binding.pry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment