CMPSCI 187: Programming With Data Structures
David Mix Barrington
Fall, 2012
Solution to Programming Project #2
Project #2 was to create a class called
SudokuSolver.java
,
which has just one method to be called from outside, named
solve
,
that solves Sudoku puzzles. You also need three auxiliary classes,
so here are the four files for the project, in versions written
by Jacqueline Feild and edited by David Mix Barrington:
- SudokuSolver.java, the class with
the
solve
method,
- Board.java, the class whose objects
have
9 by 9 arrays of ints for the board contents and 9 by 8 arrays of
booleans
to tell which entries are fixed,
- Move.java, the class whose objects
have
three ints and record one change of an entry in a Board, and
- BadMoveException.java, an exception thrown if a
Board
is asked to change a fixed entry.
Last modified 7 October 2012