Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Method: Puzzle AddKillerCage(int, string, int, ConsoleColor?, ConsoleColor?)

  • Declared in: PuzzleSolvers.Puzzle

Declaration

public Puzzle AddKillerCage(
    int sum,
    string affectedCells,
    int gridWidth = 9,
    ConsoleColor? foreground = null,
    ConsoleColor? background = null
)

Summary

Adds a cage (region) for a Killer Sudoku. This is just a SumConstraint and a UniquenessConstraint for the same region.

Parameters

intsum The desired sum for the cage.
stringaffectedCells A string representation of the set of cells contained in this cage, in the format understood by Constraint.TranslateCoordinates(string, int).
intgridWidth The width of the puzzle grid.
ConsoleColor?foreground Color to use when outputting a solution with Puzzle.SolutionToConsole(int?[], int).
ConsoleColor?background Background color to use when outputting a solution with Puzzle.SolutionToConsole(int?[], int).

Returns

A collection containing the two required constraints.