We can do this in Java and similar languages:
for (int i=0, int j=3; i<=2 && j<=5;i++,j++){
do some repetive task until the condition becomes false...
}
How might one keep these two conditions based on two different sets (suppose two
arrays whose indexes can be used as i and j) in condition block?
explicit iteration is kinda looked down upon in ruby as poor expression of thought. Usually there is a better way to achieve the desired goal.
That said, here’s is best way I know of to iterate many variables:
You can also do it a little messier
Edit: If you want to go from 0 to 2, and 3 to 5, this works: