Next / Previous / Contents / Shipman's homepage

5.2. Manifest constants

First we define some constants needed everywhere in the solution.

sudosolver.py
#================================================================
# Manifest constants
#----------------------------------------------------------------
SUBMAT_L

Size of a submatrix.

sudosolver.py
SUBMAT_L  =  3
MAT_L

Dimensions of the matrix (9).

sudosolver.py
MAT_L  =  SUBMAT_L ** 2
BOARD_L

Size of the list representing the entire matrix (81).

sudosolver.py
BOARD_L  =  MAT_L ** 2
EMPTY

The value used to represent empty cells.

sudosolver.py
EMPTY  =  0