On 2/11/06, Matthew Smillie <M.B.Smillie / sms.ed.ac.uk> wrote:

Thanks Matthew, I appreciate you taking the time
to reword this for me, but there is one part that is
still bothering me.

> > The block should take two parameters and return a boolean value.

Its the thing with the boolean that I dont get. This seems to be asuming
some prior knowledge of a particular ruby method.
I've searched Array and String and dont see anything that fits.

What is this boolean supposed to show? Booleans can me on/off
true/false, found/not_found, or many other things.

If the guide just stated what the boolean is for, or even better what
method they want used that returns a boolean I'm sure this would
be a rather simple problem.

Finding the longest or shortest string in an array is so trivial.
This really seems more like an exercise on howto structure blocks
and pass variables to methods.

result = arr.sort_by {|w| w.length};
shortest,longest = result[0],result[-1]
--
Alex Combas
http://noodlejunkie.blogspot.com/