On Jan 23, 8:34 pm, jordantheous <[email protected]> wrote:
> *From Chris Pine, Learn to Program
>
> Hey All --
> In the below source code they array is called in the method as x, y,
> but the "if" statements are looking to [y][x].  Can anyone explain to
> me why they are switched?  If you make them [x][y] it still outputs
> the correct number (23).
> Thanks in advance,
> Jordan
>

What you've got there is an array of rows (rather than an actual 2D
construct), so it's normal that [y][x] first selects a row, then an
element in that row.

Fred
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to