Revision: 17443
Updated Code
at September 4, 2009 17:30 by AzizLight
Updated Code
def decimal_to_binar(x) z = [] while x >= 1 z << x % 2 x /= 2 end z.reverse.join(" ") end number = gets.chomp puts "decimal : #{number}nbinary : #{decimal_to_binar(number.to_i)}"
Revision: 17442
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at September 4, 2009 17:30 by AzizLight
Initial Code
def decimal_to_binar(x) z = [] while x >= 1 z << x % 2 x /= 2 end z.reverse.join(" ") end number = gets.chomp puts "decimal : #{number}nbinary : #{decimal_to_binar(number.to_i)}"
Initial URL
Initial Description
Initial Title
Decimal to Binary Terminal Script
Initial Tags
textmate, ruby, terminal
Initial Language
Ruby