Refactor Sudoku field and solver implementation
This commit is contained in:
@@ -13,7 +13,7 @@ type NakedSingle struct {
|
||||
func (ns *NakedSingle) SearchProgressableCells() int {
|
||||
ns.field.ForEachPart(func(part field.Part) {
|
||||
part.ForEachCell(func(cell *field.Cell) {
|
||||
candidates := cell.Notes.Get()
|
||||
candidates := cell.GetNotes().Get()
|
||||
if len(candidates) == 1 && cell.GetNumber() == 0 {
|
||||
change := field.ExternalChange{
|
||||
Cell: cell,
|
||||
@@ -22,7 +22,7 @@ func (ns *NakedSingle) SearchProgressableCells() int {
|
||||
From: cell.GetNumber(),
|
||||
TriggerdBy: ns.getName(),
|
||||
}
|
||||
ns.changes = append(ns.changes, change)
|
||||
ns.queue(change)
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -33,6 +33,10 @@ func (ns *NakedSingle) getName() string {
|
||||
return "Naked Single"
|
||||
}
|
||||
|
||||
func (ns *NakedSingle) Name() string {
|
||||
return ns.getName()
|
||||
}
|
||||
|
||||
// ────────────────────────────────────────────────────────────────────────────── //
|
||||
// NAKED_DOUBLE STRUCTURE //
|
||||
// ────────────────────────────────────────────────────────────────────────────── //
|
||||
|
||||
Reference in New Issue
Block a user