From: botp Date: 2011-04-17T10:04:55+09:00 Subject: Re: For loops trouble On Sun, Apr 17, 2011 at 2:27 AM, Daniel Johnson wrote: >   for(int i = 0; a[i] < x;i++) there are many ways. eg, > x => 6 > a => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] > a.take_while{|e| e [1, 2, 3, 4, 5] > a.each_with_index.take_while{|e| e [[1, 0], [2, 1], [3, 2], [4, 3], [5, 4]] kind regards -botp