Thursday, October 28, 2010

For loop iteration in Scala

The Scala for loop notation:
for (i<-0 until some.length)


basically means, in java-ish code:
for (int i=0; i < some.length; i++)

So, the reason we were only getting a 7x7 board was because Scala iterates using the "until" as non-inclusive to the some.length (i.e. less than).

No comments:

Post a Comment