How do I increment the loop by 2 as equivalent to this in Java:
for (int i = 0; i < max; i+=2)
Right now in Scala I have:
for (a <- 0 to max)
For a fact max will always be even. I don't know how to increment the counter to 2 in each loop.
max
Try for (a <- 0 until max by 2)
for (a <- 0 until max by 2)
1.4m articles
1.4m replys
5 comments
57.0k users