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 }