package strategies import ( "fmt" "git.kleiax.de/homepage/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 *board.Cell part.ForEachCell(func(cell *board.Cell) { if cell.GetNumber() == 0 { emptyCell = cell } }) change := board.ExternalChange{ Cell: emptyCell, Action: board.ActionSetNumber, Value: missingNumbers[0], From: emptyCell.GetNumber(), TriggerdBy: ld.getName(), } ld.changes = append(ld.changes, change) } }) fmt.Printf("LastDigit Changes %d\n", 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 }