Initial commit
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package strategies
|
||||
|
||||
import "git.kleiax.de/homepage/libs/sudoku/board"
|
||||
|
||||
// ────────────────────────────────────────────────────────────────────────────── //
|
||||
// NAKED_SINGLE STRUCTURE //
|
||||
// ────────────────────────────────────────────────────────────────────────────── //
|
||||
|
||||
type NakedSingle struct {
|
||||
Base
|
||||
}
|
||||
|
||||
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)
|
||||
// }
|
||||
})
|
||||
})
|
||||
return len(ns.changes)
|
||||
}
|
||||
|
||||
// ────────────────────────────────────────────────────────────────────────────── //
|
||||
// NAKED_DOUBLE STRUCTURE //
|
||||
// ────────────────────────────────────────────────────────────────────────────── //
|
||||
|
||||
type NakedPair struct {
|
||||
Base
|
||||
}
|
||||
|
||||
// ────────────────────────────────────────────────────────────────────────────── //
|
||||
// NAKED_TRIPLE STRUCTURE //
|
||||
// ────────────────────────────────────────────────────────────────────────────── //
|
||||
|
||||
type NakedTriple struct {
|
||||
Base
|
||||
}
|
||||
Reference in New Issue
Block a user