I\'m very new to Scala, so forgive my ignorance! I\'m trying to iterate of pairs of integers that are bounded by a maximum. For example, if the maximum is 5, then the iterat
Maybe an Iterator is better suited for you?
class PairIterator (max: Int) extends Iterator [(Int, Int)] { var count = -1 def hasNext = count <= max * max def next () = { count += 1; (count / max, count % max) } } val pi = new PairIterator (5) pi.take (7).toList