package strategies import "git.kleiax.de/homepage/libs/sudoku/board" // ────────────────────────────────────────────────────────────────────────────── // // LAST_DIGIT STRUCTURE // // ────────────────────────────────────────────────────────────────────────────── // type LastDigit struct { Base } func (ld *LastDigit) SearchProgressableCells() int { ld.field.ForEachPart(func(part board.Part) { missingNumbers := part.GetMissingNumbers() if len(missingNumbers) == 1 { // var emptyCell *Cell // part.forEachCell(func(cell *Cell) { // if cell.number == 0 { // emptyCell = cell // } // }) // change := Change{ // cell: emptyCell, // action: ActionSetNumber, // value: missingNumbers[0], // } // ld.changes = append(ld.changes, change) } }) //fmt.Printf("LastDigit Changes %d", len(ld.changes)) return len(ld.changes) } func (ld *LastDigit) getName() string { return "Last Digit - Letzte Zahl" } // ────────────────────────────────────────────────────────────────────────────── // // CRP STRUCTURE // // ────────────────────────────────────────────────────────────────────────────── // type CRP struct { Base } // ────────────────────────────────────────────────────────────────────────────── // // SIMPLE_COLORING_T1 STRUCTURE // // ────────────────────────────────────────────────────────────────────────────── // type SimpleColoringT1 struct { Base }