-
Notifications
You must be signed in to change notification settings - Fork 1
/
hst_xwing_test.go
32 lines (26 loc) · 1.15 KB
/
hst_xwing_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package sudoku
import (
"testing"
)
//TODO: test a few more puzzles to make sure I'm exercising it correctly.
func TestXWingRow(t *testing.T) {
options := solveTechniqueTestHelperOptions{
targetCells: []CellRef{{1, 4}, {1, 7}, {8, 4}},
pointerCells: []CellRef{{0, 4}, {0, 7}, {7, 4}, {7, 7}},
targetNums: IntSlice([]int{9}),
description: "in rows 0 and 7, 9 is only possible in columns 4 and 7, and 9 must be in one of those cells per rows, so it can't be in any other cells in those columns",
}
humanSolveTechniqueTestHelper(t, "xwingtest.sdk", "XWing Row", options)
techniqueVariantsTestHelper(t, "XWing Row")
}
func TestXWingCol(t *testing.T) {
options := solveTechniqueTestHelperOptions{
transpose: true,
targetCells: []CellRef{{4, 1}, {7, 1}, {4, 8}},
pointerCells: []CellRef{{4, 0}, {7, 0}, {4, 7}, {7, 7}},
targetNums: IntSlice([]int{9}),
description: "in columns 0 and 7, 9 is only possible in rows 4 and 7, and 9 must be in one of those cells per columns, so it can't be in any other cells in those rows",
}
humanSolveTechniqueTestHelper(t, "xwingtest.sdk", "XWing Col", options)
techniqueVariantsTestHelper(t, "XWing Col")
}