Skip to content

Commit b0d0306

Browse files
committed
test scope fix/sudoku test formatting
This commit fixes a bug in test scopes related to solveInit. Also fixes documentation placement in sudoku_test
1 parent 2671b84 commit b0d0306

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

internal/xo/s.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,9 @@ func (s *S) cleanupSolve() {
635635
drvd := s.Driver.Derive(s.x)
636636
if drvd.TargetLevel < s.endTestLevel {
637637
trail.Back(s.endTestLevel)
638-
s.x = CNull
639-
//break
638+
trail.Assign(drvd.Unit, drvd.P)
639+
s.x = trail.Prop()
640+
continue
640641
}
641642
trail.Back(drvd.TargetLevel)
642643
trail.Assign(drvd.Unit, drvd.P)

sudoku_test.go

+10-9
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,15 @@ func Example_sudoku() {
9999
}
100100
}
101101
fmt.Printf("\n")
102-
// Output: 5 2 9 1 3 6 7 4 8
103-
// 4 3 1 7 8 5 2 9 6
104-
// 8 7 6 4 9 2 1 3 5
105-
// 1 6 3 2 4 8 5 7 9
106-
// 2 4 5 9 1 7 8 6 3
107-
// 7 9 8 5 6 3 4 1 2
108-
// 6 5 4 3 2 1 9 8 7
109-
// 3 1 2 8 7 9 6 5 4
110-
// 9 8 7 6 5 4 3 2 1
102+
111103
}
104+
// Output: 5 2 9 1 3 6 7 4 8
105+
// 4 3 1 7 8 5 2 9 6
106+
// 8 7 6 4 9 2 1 3 5
107+
// 1 6 3 2 4 8 5 7 9
108+
// 2 4 5 9 1 7 8 6 3
109+
// 7 9 8 5 6 3 4 1 2
110+
// 6 5 4 3 2 1 9 8 7
111+
// 3 1 2 8 7 9 6 5 4
112+
// 9 8 7 6 5 4 3 2 1
112113
}

0 commit comments

Comments
 (0)