Topic: "for" Two objects

i like each method iun ruby but i'm looking for a loop for two objects

in C syntax.

for( i=0, j=0 ; i < 5 ; i++, j++) {

how could be in Ruby syntax?

@is.each {|i| ..... blah blah


saludos desde chilito lindo.

sorry for my english

Re: "for" Two objects

5.times do |i|
  5.times do |j|
    #stuff with i and j

Is this what you meant?

Re: "for" Two objects

i want two objects changing at the same time

your code mean this

for (i=0; i< 5; i++) {
  for (j=0; j< 5; j++) {

!= for (i=0, j=0; i< 5; i++, j++) {



Re: "for" Two objects

can you give more context to this problem. It seems to me that the "j" variable is equivalent to i; why not just use "i" for whatever behavior you're trying to achieve?