SuDokuPuzzle

SuDokuPuzzle


This class represents a rectangular Sudoku puzzle.


Author: Adam T. Yarnott, Blue Ninja Software
Modified: 12-18-2005

Class Diagram

SuDokuPuzzle

Public:

Types:

NameDescription
 Constraints Indicates the constraints that are enforced for the game. 
 MoveResults Indicates the result of a move.  

Properties:

NameDescription
 Cols (get) Returns the number of columns for the game. 
 Constraints (get) Returns the constraints enforced in the game. 
 Digit (get) Returns the digit at the given square.  
 IsGiven (get) Returns whether the specified square was a given.  
 MaxDigit (get) Returns the highest digit allowed in the game. 
 Region (get) Returns the numbered region to which a square belongs.  
 Region (let) Sets the numbered region to which a square belongs.  
 Rows (get) Returns the number of rows for the game. 

Methods:

NameDescription
 CheckMove Determines the result of a specified move.  
 GetIndexFromMatrix Returns the linear index of a square, based on its row and column.  
 Init Initializes the game board to the given dimensions.  
 IsPuzzleComplete Returns whether the entire puzzle is completed. 
 IsRegionComplete Returns whether the specified region is completed.  
 MakeMove Attempts to make the specified move, and returns the result.  
 NewGame Resets the board and initializes the given squares.  
 SetMatrixFromIndex Sets the row and column matrix for a square based on its linear index.  

Events:

NameDescription
 Change Raised to indicate that a square has changed.  

Remarks

Since the digits and regions are identified numerically, a GUI application can interpret these as numbers, letters, symbols, colors, etc.

Also, this class can support irregular or non-rectangular regions. This allows a GUI to produce many variations on the Sudoku theme.

Features include:

Documentation compiled on Wednesday, December 21, 2005 using VBDOX (c) M.Stamenov
Documentation by Adam Yarnott, Blue Ninja Software