refactore to new project structure

This commit is contained in:
2026-07-19 11:18:16 +02:00
parent 1ff0efb557
commit 9a69d4610c
12 changed files with 108 additions and 81 deletions
+12 -10
View File
@@ -1,6 +1,6 @@
package strategies
import "git.kleiax.de/homepage/libs/sudoku/board"
import "git.kleiax.de/homepage/board"
// ────────────────────────────────────────────────────────────────────────────── //
// NAKED_SINGLE STRUCTURE //
@@ -13,15 +13,17 @@ type NakedSingle struct {
func (ns *NakedSingle) SearchProgressableCells() int {
ns.field.ForEachPart(func(part board.Part) {
part.ForEachCell(func(cell *board.Cell) {
// candidates := cell.notes.numbers
// if len(candidates) == 1 {
// change := Change{
// cell: cell,
// action: ActionSetNumber,
// value: candidates[0],
// }
// ns.changes = append(ns.changes, change)
// }
candidates := cell.Notes.Get()
if len(candidates) == 1 {
change := board.ExternalChange{
Cell: cell,
Action: board.ActionSetNumber,
Value: candidates[0],
From: cell.GetNumber(),
TriggerdBy: ns.getName(),
}
ns.changes = append(ns.changes, change)
}
})
})
return len(ns.changes)