huh... it looks like I was confusing myself and doing way more work than I
need to again. when it said the first number less than... i took that to
mean the first number chronologically not the first number from left to
right. but I suppose that does make sense. thanks for clarifying that for
me, and sorry for the confusion

On Sun, Dec 4, 2016 at 2:54 AM, Robert Klemme <shortcutter / googlemail.com>
wrote:

> On Sat, Dec 3, 2016 at 11:28 PM, Micky Scandal <mickyscandal / gmail.com>
> wrote:
>
> > Return the first number from an Array that is less than a particular
> number
> > - 'limit.' You should make use of Enumerable#find
>
> That is a different problem to solve than the one described in the
> subject. So which is it that you want to solve?
>
> > and then gives me this code to work with:
> >
> > def first_under(array, limit)
> >
> > end
> >
> > puts first_under([13, 21, 7, 0, 11, 106], 10) == 7
>
> From the name of the method it seems your subject is wrong and you are
> really seeking the first number less than the limit. But your first
> solution posted rather tries to implement the subject. I think
> Guiilaume's solution is spot on:
>
> array.find { |num| num < limit }
>
> This is a nice illustration how important it is to *first* clarify
> what problem to solve before coding solutions.
>
> Kind regards
>
> robert
>
>
> --
> [guy, jim, charlie].each {|him| remember.him do |as, often| as.you_can
> - without end}
> http://blog.rubybestpractices.com/
>
> Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
>
(supressed text/html)
Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>