refactore to new project structure
This commit is contained in:
+12
-10
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user