clone

fifteen puzzle games for the terminal, with daily puzzles, weekly ladders and xp, built on bubble tea

lint/fmt

Dami committed 28e7fd5
commit
28e7fd57edca7cf472c74e91f3347a7164518cc9
parent
a050ef95a7989db672cbe761f835bbc9b613ec60
author
Dami <dami.etoile@gmail.com>
4 files changed, +5 -47
Mnonogram/generator.go10---------
Mnonogram/nonogram_test.go4++--
Mnurikabe/generator.go6+++---
Mnurikabe/solver.go32------------------------------
M nonogram/generator.go +0 -10
M nonogram/nonogram_test.go +2 -2
M nurikabe/generator.go +3 -3
M nurikabe/solver.go +0 -32
@@ -169,14 +169,6 @@ func CountSolutionsContext(ctx context.Context, puzzle Puzzle, limit, nodeLimit
169169 return solutions, stats, nil170170 }171171 172-func propagate(g grid, clues clueGrid) error {173- if len(g) == 0 || len(g[0]) == 0 {174- return nil175- }176- scratch := newSolverScratch(len(g[0]), len(g))177- return propagateWithScratch(g, clues, scratch)178-}179-180172 func propagateWithScratch(g grid, clues clueGrid, scratch *solverScratch) error {181173 height := len(g)182174 if height == 0 {
@@ -252,14 +244,6 @@ func propagateWithScratch(g grid, clues clueGrid, scratch *solverScratch) error
252244 }253245 }254246 255-func validatePartial(g grid, clues clueGrid) error {256- if len(g) == 0 || len(g[0]) == 0 {257- return nil258- }259- scratch := newSolverScratch(len(g[0]), len(g))260- return validatePartialWithScratch(g, clues, scratch)261-}262-263247 func validatePartialWithScratch(g grid, clues clueGrid, scratch *solverScratch) error {264248 if hasSeaSquare(g) {265249 return fmt.Errorf("contains 2x2 sea block")
@@ -389,14 +373,6 @@ func candidateOrder(g grid, clues clueGrid, x, y int) []cellState {
389373 return []cellState{seaCell, islandCell}390374 }391375 392-func seaCanRemainConnected(g grid) bool {393- if len(g) == 0 || len(g[0]) == 0 {394- return true395- }396- scratch := newSolverScratch(len(g[0]), len(g))397- return seaCanRemainConnectedWithScratch(g, scratch)398-}399-400376 func seaCanRemainConnectedWithScratch(g grid, scratch *solverScratch) bool {401377 height := len(g)402378 if height == 0 {
@@ -628,14 +604,6 @@ func componentCanReachClueWithScratch(
628604 return false629605 }630606 631-func maxReachableForComponent(g grid, clues clueGrid, comp islandComponent) int {632- if len(g) == 0 || len(g[0]) == 0 {633- return 0634- }635- scratch := newSolverScratch(len(g[0]), len(g))636- return maxReachableForComponentWithScratch(g, clues, comp, scratch)637-}638-639607 func maxReachableForComponentWithScratch(640608 g grid,641609 clues clueGrid,