--- a/progs/sudoku.scala Tue Dec 03 11:07:09 2019 +0000
+++ b/progs/sudoku.scala Mon Jan 27 10:18:13 2020 +0000
@@ -64,6 +64,10 @@
}
}
+def pretty(game: String): String =
+ "\n" + (game.sliding(maxValue, maxValue).mkString(",\n"))
+
+
// a list of hard games according to Andrew Coles and Peter Norvig
val hard_games =
@@ -180,6 +184,9 @@
"....14....3....2...7..........9...3.6.1.............8.2.....1.4....5.6.....7.8...",
"4.....8.5.3..........7......2.....6.....8.4......1.......6.3.7.5..2.....1.4......")
+println("108:\n" ++ pretty(hard_games(108).replaceAll("\\.", " ")) ++ "\n")
+println("109:\n" ++ pretty(hard_games(109).replaceAll("\\.", " ")) ++ "\n")
+
// for measuring time
def time_needed[T](i: Int, code: => T) = {