From: Greg Willits Date: 2010-09-06T18:23:57+09:00 Subject: Re: My First Application Jason Hhh wrote: > I have worked with PHP in the past and have been playing with Ruby for a > few weeks. I made a program that I would love to get feedback on. Any > comments would be great. I have my program on Git hub. > > http://github.com/jasonhamilton/NZBMatrix-Downloader Well, the conversion isn't accurate yet, but using your approach, here's another way to do it that allows you to easily grow the list of numerals to be converted: def convert(b10number) numerals = ['M','D','C','L','X','V','I'] values = [1000,500,100,50,10,5,1] implemented = [] conversion = "" remainder = b10number values.each do |this_value| if this_value > 1 implemented << remainder/this_value remainder = remainder % this_value else implemented << remainder end end implemented.each_with_index do |this_many, indx| conversion += (numerals[indx] * this_many) end puts conversion end puts 'Howdy there, enter a number and I\'ll convert it to the older Roman Numeral fashion!' argument = gets.chomp.to_i convert argument -- Posted via http://www.ruby-forum.com/.