author | Christian Urban <urbanc@in.tum.de> |
Thu, 03 Nov 2016 01:05:20 +0000 | |
changeset 7 | 7a5a29a32568 |
parent 6 | aae256985251 |
child 8 | ab77f6006f1f |
--- a/progs/knight2.scala Thu Nov 03 00:53:53 2016 +0000 +++ b/progs/knight2.scala Thu Nov 03 01:05:20 2016 +0000 @@ -28,7 +28,7 @@ def tour(n: Int)(steps: List[Pos]): List[List[Pos]] = { if (steps.length == n * n) List(steps) else - (for (x <- moves(n)(steps.head); if (!steps.contains(x))) yield tour(n)(x :: steps)).flatten + (for (x <- moves(n)(steps.head).par; if (!steps.contains(x))) yield tour(n)(x :: steps)).toList.flatten } //val n = 8