Hi --

On Thu, 24 Nov 2005, Robert Klemme wrote:

> jemptymethod / gmail.com wrote:
>> I'm brand new to ruby, as in, one hour!  So along with perhaps
>> answering my very basic question, please feel free to point me to
>> other resources on the web
>>
>> How do I fix the following so that entering 'q' indeed breaks out of
>> the loop?  I've read the following but think I will need to see an
>> example to truly understand.
>>
>> Thanks in advance
>>
>> BTW I always learn new language basics by figuring out how to convert
>> to roman numerals
>>
>>
>> arabic = ' '
>> while arabic != 'q' do
>>   puts "Enter a whole number from 1 to 3999 for conversion"
>>   puts "to Roman Numerals (enter 'q' to exit)"
>>   arabic = gets
>> end
>
> Here's another way to do it
>
> begin
>   puts "Enter a whole number from 1 to 3999 for conversion"
>   puts "to Roman Numerals (enter 'q' to exit)"
>   arabic = gets.chomp
> end until arabic == 'q'

Although... see ruby-core 6745.  Matz doesn't like this construct, and
it may disappear.


David

-- 
David A. Black
dblack / wobblini.net