Tips for golfing in Scala
The shortest way of repeating something is with Seq.fill.

1 to 10 map(_=&gt;println("hi!")) // Wrong!
for(i&lt;-1 to 10)println("hi!") // Wrong!
Seq.fill(10)(println("hi!")) // Right!