Skip to content

Instantly share code, notes, and snippets.

@rubydubee
Created June 30, 2011 22:36
Show Gist options
  • Save rubydubee/1057463 to your computer and use it in GitHub Desktop.
Save rubydubee/1057463 to your computer and use it in GitHub Desktop.
Base Converter gist
# This program shows various ways of writing 100
require 'base_converter'
bc = BaseConverter.new
(2..36).each do |num|
x = bc.dec_to_base(num,100)
puts "100 in base-#{num} is written as #{x}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment