package strategies import "git.kleiax.de/homepage/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.Get() if len(candidates) == 1 { change := board.ExternalChange{ Cell: cell, Action: board.ActionSetNumber, Value: candidates[0], From: cell.GetNumber(), TriggerdBy: ns.getName(), } ns.changes = append(ns.changes, change) } }) }) return len(ns.changes) } // ────────────────────────────────────────────────────────────────────────────── // // NAKED_DOUBLE STRUCTURE // // ────────────────────────────────────────────────────────────────────────────── // type NakedPair struct { Base } // ────────────────────────────────────────────────────────────────────────────── // // NAKED_TRIPLE STRUCTURE // // ────────────────────────────────────────────────────────────────────────────── // type NakedTriple struct { Base }