progs/sudoku.scala
changeset 384 6e1237691307
parent 383 c02929f2647c
child 449 d67c5f7177a6
--- a/progs/sudoku.scala	Mon Dec 07 01:25:41 2020 +0000
+++ b/progs/sudoku.scala	Fri Jan 15 02:40:57 2021 +0000
@@ -21,8 +21,10 @@
 
 def empty(game: String) = game.indexOf(emptyValue)
 def isDone(game: String) = empty(game) == -1 
+
 //def emptyPosition(game: String) : Pos = 
 //  (empty(game) % maxValue, empty(game) / maxValue)
+
 def emptyPosition(game: String) = {
   val e = empty(game)
   (e % maxValue, e / maxValue)
@@ -82,8 +84,7 @@
        "6.2.5.........3.4..........43...8....1....2........7..5..27...........81...6.....",
        ".524.........7.1..............8.2...3.....6...9.5.....1.6.3...........897........",
        "6.2.5.........4.3..........43...8....1....2........7..5..27...........81...6.....",
-       ".923.........8.1...........1.7.4...........658.........6.5.2...4.....7.....9.....")
-/*
+       ".923.........8.1...........1.7.4...........658.........6.5.2...4.....7.....9.....",
        "85...24..72......9..4.........1.7..23.5...9...4...........8..7..17..........36.4.",
        "..53.....8......2..7..1.5..4....53...1..7...6..32...8..6.5....9..4....3......97..",
        "12..4......5.69.1...9...5.........7.7...52.9..3......2.9.6...5.4..9..8.1..3...9.4",
@@ -187,7 +188,7 @@
        "3...8.......7....51..............36...2..4....7...........6.13..452...........8..",
        "....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")