NNM Sudoku Magic

# History of moves

All the moves that you have done can be retraced. You can go back and forth in history and also load a specific state into the gameboard.

# Import Sudoku

You can copy the current state of the Sudoku matrix and then re-import it. Use the same structure as in the indicated matrices. If you are stuck and want to try several paths, then you can copy your current state and easily go back to that state if you enter a dead end. You can also use the History page to load different states of the Sudoku matrix.

`{{matrix}}`
`{{matrix.statisticsAsString()}}`

# Documentation

A good starting point if you are new to Sudoku is to look at Wikipedia's Sudoku page. I will not go into details about the rules, history and mathematics in the documentation below, instead I will focus on the details for the NNM Sudoku Magic implementation.

## Gameboard

The Gameboard consists of 81 cells, layed out in a 9x9 matrix. There are nine rows, nine columns and also nine 3-by-3 squares in the matrix.

To get a recursive feeling, the gameboard consists of one matrix. The matrix contains nine 3-by-3 squares. Each 3-by-3 square contains nine cells. Each cell contains either a value or a list of nine potential values.

The maths will sum up to:

• 1 matrix
• 9 3-by-3 squares.
• 81 (9x9 or 92) cells.
• 81 lists with 9 potential values each, giving 729 (9x9x9 or 93) potential value elements.

## Matrix

The matrix consists of 81 cells placed in an array. Each cell gets an index, and since I am a computer scientist, the indices are numbered 0-80.

## Cell

Each cell has:

• a current state
• a current value (may be null)
• a set (may be empty) of potential values (in the range 1-9)
• a set (may be empty) of unique potential values
• three sets of neighbours, i.e. the eight cells that are in the same row, the same column or the same 3-by-3 square, which means that each cell has twenty neighbours (when duplicates are removed)

### Neighbour cells

The cells in the same row, column or 3-by-3 square as a cell C are called C's neighbours. There are eight neighbours in the same row, eight neighbours in the same column and eight neighbours in the same 3-by-3 square, but four of these are duplicates, so each cell has a total of twenty unique neighbour cells.

### Cell states

A cell is always in exactly one state. It can be either of:

• EMPTY, when the cell has no value. This is also the starting state for each cell. When the cell is empty, all its potential values are shown. An empty cell may under some circumstances be in one of the following sub-states:
• ILLEGAL_STATE, when there are no remaining potential values, i.e. every valid value will collide with (at least) one neighbour.
• SINGLE_VALUE_LEFT, there is only one potential value left for the cell.
• UNIQUE_POTENTIAL_VALUE, this is the only cell in a row/column/3-by-3 that has a specific potential value left. If several values in the same cell are marked as unique potential value you are probably in a dead end.
• VALUE, there is a correct value, 1-9, defined.

# About

The NNM Sudoku Magic is not an automatic solver, but merely a tool for helping you manually filling in the mundane parts of a puzzle, helping you in the verification of the result, helping you to avoid dead ends and educate in how Sudoku works. You will still have to do the hard work yourself.

The NNM Sudoku Magic is developed by Anders Gustafson. The first version was built with AngularJS and was released in . This second version was released in and is using Vue (version 2.6.10) and Bootstrap (version 4.3.1), in addition to plain HTML, CSS and JavaScript.

This second version is a complete rewrite from the first version. The best ideas from the first version are enhanced and refined and many new ideas are also implemented. The GUI for this version is hopefully much easier to use, since many unnecessary steps were removed.