Created
February 6, 2016 06:07
-
-
Save osyoyu/f8ae4a46499b4c22e777 to your computer and use it in GitHub Desktop.
bi_print
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
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