- commit
- f269c2c85d1b54d61a82a1e79c358efc0b5de4fe
- parent
- cd22638aa0e504b8889900fd1d548225530679ba
- author
- Dami <dami.etoile@gmail.com>
| M | sudoku/ | 12 | +++++++++--- |
| M | wordsearch/ | 21 | ++++++++++++++------- |
@@ -104,9 +104,15 @@ func TestIsValid(t *testing.T) {
104104 // Place value 1 in center of each 3x3 box, then verify no cross-box conflict.105105 g := emptyGrid()106106 centers := [][2]int{107- {1, 1}, {4, 1}, {7, 1},108- {1, 4}, {4, 4}, {7, 4},109- {1, 7}, {4, 7}, {7, 7},107+ {1, 1},108+ {4, 1},109+ {7, 1},110+ {1, 4},111+ {4, 4},112+ {7, 4},113+ {1, 7},114+ {4, 7},115+ {7, 7},110116 }111117 for _, c := range centers {112118 g[c[1]][c[0]].v = 1@@ -288,43 +288,50 @@ func TestWalkLine(t *testing.T) {
288288 }{289289 {290290 "horizontal line",291- game.Cursor{X: 0, Y: 0}, game.Cursor{X: 3, Y: 0},291+ game.Cursor{X: 0, Y: 0},292+ game.Cursor{X: 3, Y: 0},292293 true,293294 []Position{{0, 0}, {1, 0}, {2, 0}, {3, 0}},294295 },295296 {296297 "vertical line",297- game.Cursor{X: 2, Y: 0}, game.Cursor{X: 2, Y: 3},298+ game.Cursor{X: 2, Y: 0},299+ game.Cursor{X: 2, Y: 3},298300 true,299301 []Position{{2, 0}, {2, 1}, {2, 2}, {2, 3}},300302 },301303 {302304 "diagonal line",303- game.Cursor{X: 0, Y: 0}, game.Cursor{X: 2, Y: 2},305+ game.Cursor{X: 0, Y: 0},306+ game.Cursor{X: 2, Y: 2},304307 true,305308 []Position{{0, 0}, {1, 1}, {2, 2}},306309 },307310 {308311 "reverse diagonal",309- game.Cursor{X: 2, Y: 2}, game.Cursor{X: 0, Y: 0},312+ game.Cursor{X: 2, Y: 2},313+ game.Cursor{X: 0, Y: 0},310314 true,311315 []Position{{2, 2}, {1, 1}, {0, 0}},312316 },313317 {314318 "adjacent cells",315- game.Cursor{X: 0, Y: 0}, game.Cursor{X: 1, Y: 0},319+ game.Cursor{X: 0, Y: 0},320+ game.Cursor{X: 1, Y: 0},316321 true,317322 []Position{{0, 0}, {1, 0}},318323 },319324 {320325 "invalid line",321- game.Cursor{X: 0, Y: 0}, game.Cursor{X: 1, Y: 2},326+ game.Cursor{X: 0, Y: 0},327+ game.Cursor{X: 1, Y: 2},322328 false,323329 nil,324330 },325331 {326332 "same point",327- game.Cursor{X: 1, Y: 1}, game.Cursor{X: 1, Y: 1},333+ game.Cursor{X: 1, Y: 1},334+ game.Cursor{X: 1, Y: 1},328335 false,329336 nil,330337 },