Refactor Sudoku solver architecture
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user