--00c09f9058e0968db9047287b5a2 Content-Type: text/plain; charset=ISO-8859-1 On Tue, Sep 1, 2009 at 10:11 AM, John W Higgins <wishdev / gmail.com> wrote: > Morning Max, > > On Tue, Sep 1, 2009 at 9:41 AM, Max Williams <toastkid.williams / gmail.com > >wrote: > > > Little ruby algorithm puzzle... > > > > I have a situation where i have an array of 12 items. If someone > > chooses to have n of them (where n can be between 3 and 12) then i want > > to always include the first and last, and then 'spread' the others out > > as evenly as possible between the rest. > > > > So, lets say for the sake of argument that the array holds the numbers 1 > > to 12. > > > > >> arr 1..12).to_a > >