On Sat, Dec 10, 2011 at 12:02 AM, Emeka Patrick <emekapatrick / gmail.com> wr=
ote:
> Thanks so much for getting back to me and for your kind words. Really
> big encouragement for someone just starting out and feeling a wee bit
> lost at times. As well, I must say the willingness of people in the Ruby
> community to offer help has really been pretty amazing.

It's among the most friendly online communities I have come across -
if not the most friendly.

>> That would also be correct. One other small item, normally code is
>> indented
>> (Ruby standard is 2 spaces) another level inside a control statement
>> (if/while/else and such) to make it slightly easier to read the code.
>
> I've been trying to do this as well as line up certain elements of code,
> but keep slipping in my enthusiasm to get it all out there. Def. need to
> try harder to keep it up. What about using Tab to indent, is there =A0any
> reason that might be frowned upon? Btw, I'm using TextMate.

I think people don't like the large indent especially when posting
code in emails or forums because there usually line width is limited
or lines are wrapped automatically.

> Oh wow, ok, I think I get it. This is super clean too. Much nicer than
> what I originally had. Now, one last question, I need response =3D
> gets.chomp in the first instance just to define what the variable stands
> for, correct?

Partly.  The more important aspect in this case is that you need to
have a value which is checked as while condition.

> It's not actually until the second instance where I'm
> soliciting input from the user, or actually is it more so the first
> instance both defines the variable and solicits =A0input from the user
> while the second instance solicits input in a continuous loop until it
> gets broken, i.e. when a user enters an empty string?

Exactly (the latter).  You could as well do this avoiding the
duplicate "gets.chomp":

responses =3D []

while (response =3D gets.chomp) !=3D ''
  responses << response
end

puts responses.sort

Kind regards

robert

--=20
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/