Class SudokuBoard

java.lang.Object
  extended by SudokuBoard

public class SudokuBoard
extends java.lang.Object

SudokuBoard - A class containing the information necessary to solve a 9x9 squiggly sudoku puzzle.

Each cell contains both a number (which the solver has placed in that cell), and a letter (A-I) indicating the region to which the cell belongs. The rows and columns of a board are numbered from 0 to 8.

Version:
February 27, 2009
Author:
Programming Contest Judges

Constructor Summary
SudokuBoard(int serialNum)
          Construct the SudokuBoard with the given serial number.
 
Method Summary
 int cellValue(int row, int col)
          Returns the value in the specified cell
 char mapValue(int row, int col)
          Returns the label for the region of the specified cell
 void printBoard()
          Print the values in the board.
 void printRegionMap()
          Print the labels for the regions in the board.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SudokuBoard

public SudokuBoard(int serialNum)
Construct the SudokuBoard with the given serial number. The SudokuBoard includes both the region map and the numbers in the solution

Parameters:
serialNum - - the serial number of the board being constructed
Method Detail

cellValue

public int cellValue(int row,
                     int col)
              throws java.lang.Exception
Returns the value in the specified cell

Parameters:
row - the row of the cell whose value is to be returned
col - the column of the cell whose value is to be returned
Returns:
the value in the cell: (row, col)
Throws:
java.lang.Exception - if row or column are out of bounds

mapValue

public char mapValue(int row,
                     int col)
              throws java.lang.Exception
Returns the label for the region of the specified cell

Parameters:
row - the row of the cell whose region is to be returned
col - the column of the cell whose region is to be returned
Returns:
the label for the region of the cell: (row, col)
Throws:
java.lang.Exception - if row or column are out of bounds

printBoard

public void printBoard()
Print the values in the board.

While potentially useful for debugging purposes, leaving a call to this method as part of a final submission will almost certainly result in an incorrect submission.


printRegionMap

public void printRegionMap()
Print the labels for the regions in the board.

While potentially useful for debugging purposes, leaving a call to this method as part of a final submission will almost certainly result in an incorrect submission.