From: "jemptymethod@..." Date: 2005-11-24T23:32:26+09:00 Subject: Re: newbie scope issue thanks everybody! i do have access to the "pickaxe" book online, plus a copy of Matz' nutshell book, which was quite helpful to me for the "numeric" methods in my script below, which i hereby release into the public domain; error checking of the user input needs to be added arabic = '' while arabic.chomp != 'q' do puts "Enter a whole number from 1 to 3999 for conversion" puts "to Roman Numerals (enter 'q' to exit)" arabic = gets iArabic = arabic.to_i roman = '' rNumerals = ['i','v','x','l','c','d','m'] rIndex = 0 while iArabic > 0 do _divmod = iArabic.divmod(10) iArabic = _divmod[0] digit = _divmod[1] rPlace = '' if digit == 4 then rPlace = rNumerals[rIndex] + rNumerals[rIndex + 1] elsif digit == 9 then rPlace = rNumerals[rIndex] + rNumerals[rIndex + 2] else if digit > 5 then rPlace = rNumerals[rIndex + 1] end rPlace += rNumerals[rIndex] * digit.modulo(5) end roman = rPlace + roman rIndex += 2 end puts roman end