--- a/progs/knight2.scala Sun Nov 13 01:27:32 2016 +0000
+++ b/progs/knight2.scala Sun Nov 13 11:56:06 2016 +0000
@@ -30,15 +30,17 @@
def tour(dim: Int, path: List[Pos]): Int = {
if (path.length == dim * dim) 1
else
- (for (x <- legal_moves(dim, path, path.head)) yield tour(dim, x::path)).sum
+ (for (x <- legal_moves(dim, path, path.head).par) yield tour(dim, x::path)).sum
}
//val n = 8
val n = 6
println(s"number simple tours: n = $n")
-//println(tour(n, List((0, 0))))
+println(tour(n, List((0, 0))))
+/*
for (d <- 1 to 6) {
println(s"${d} x ${d} " + (for (i <- 0 until d; j <- 0 until d) yield tour(d, List((i, j)))).sum)
}
+*/