diff -r d67c5f7177a6 -r 61eb4f9b8d84 progs/sudoku.scala --- a/progs/sudoku.scala Fri Dec 02 07:48:03 2022 +0000 +++ b/progs/sudoku.scala Fri Dec 02 11:05:41 2022 +0000 @@ -52,6 +52,7 @@ def candidates(game: String, pos: Pos): List[Char] = allValues.diff(toAvoid(game, pos)) + def search(game: String): List[String] = { if (isDone(game)) List(game) else @@ -59,6 +60,8 @@ map(c => search(update(game, empty(game), c))).toList.flatten } + + def search1T(games: List[String]): Option[String] = games match { case Nil => None case game::rest => { @@ -201,7 +204,7 @@ val total = - (for ((game, i) <- hard_games.zipWithIndex.par) yield { + (for ((game, i) <- hard_games.zipWithIndex) yield { val secs = time_needed(1, search(game)) println(f"${i}%2.0f: ${game} |${secs}%2.3f secs") secs