Refactor Sudoku solver architecture

This commit is contained in:
2026-09-10 23:11:34 +02:00
parent 7bf4a8d725
commit a5ec338277
21 changed files with 475 additions and 260 deletions
+5 -5
View File
@@ -1,7 +1,7 @@
package strategies
import (
"git.kleiax.de/homepage/board"
"git.kleiax.de/homepage/field"
)
// ────────────────────────────────────────────────────────────────────────────── //
@@ -13,8 +13,8 @@ type Notes struct {
}
func (n *Notes) SearchProgressableCells() int {
n.field.ForEachRow(func(row *board.Row) {
row.ForEachCell(func(cell *board.Cell) {
n.field.ForEachRow(func(row *field.Row) {
row.ForEachCell(func(cell *field.Cell) {
column, _ := n.field.GetColumn(cell.Pos.GetColumn())
block, _ := n.field.GetBlock(cell.Pos.GetBlockRow(), cell.Pos.GetBlockColumn())
candidates := intersection3(row.GetMissingNumbers(), column.GetMissingNumbers(), block.GetMissingNumbers())
@@ -22,9 +22,9 @@ func (n *Notes) SearchProgressableCells() int {
if cell.Notes.Has(note) || cell.GetNumber() != 0 {
continue
}
ch := board.ExternalChange{
ch := field.ExternalChange{
Cell: cell,
Action: board.ActionSetNote,
Action: field.ActionSetNote,
Value: note,
TriggerdBy: n.getName(),
Marks: nil,