Function Repository Resource:

# DisplayKillerSudokuPuzzle

Display a killer sudoku puzzle

Contributed by: Paritosh Mokhasi
 ResourceFunction["DisplayKillerSudokuPuzzle"][pos,vals] displays a killer sudoku puzzle based on the position pos of cages and the values vals associated with the cages.

## Details and Options

The length of the first and second arguments must be the same.
Each element of the pos must be a list containing the matrix positions of the cage. Each position in a cage represents an unknown number.
Each element of the vals must be a positive integer and represents the sum of all the numbers in that cage.
The objective is to use the cage information to find all the elements of the board such that the final solved puzzle must obey the three rules of a standard sudoku board.
The three rules of a standard sudoku board are:
First, each row must contain all the numbers 1–9.
Second, each column must contain all the numbers 1–9.
Third, each 3×3 block must contain all the numbers 1–9.

## Examples

### Basic Examples (2)

Display a killer sudoku board for specified cage positions and values:

 In[1]:=
 Out[2]=

The sudoku matrix associated with the above puzzle can be used to check the validity of the puzzle by summing the elements of each cage:

 In[3]:=
 Out[3]=

### Scope (3)

The cage positions are a List of sublists where each sublist contains the positions within that cage:

 In[4]:=
 Out[4]=

The cage values are the sums of the numbers at each position in the cage:

 In[5]:=
 Out[5]=

Create a board from the positions and values:

 In[6]:=
 Out[6]=

Paritosh Mokhasi

## Version History

• 1.0.0 – 19 May 2020