Project 1 - A Sudoku Game

Due - Wednesday, September 17, 2008

The goal of this project is to give you an opportunity to practice using Java. Your program must use classes where appropriate. Points will be awarded for good design (and deducted for bad design!). A program that contains all code in a giant main method will receive 0 points for design.

For this project, you will write a program that allows a user to play Sudoku. You can visit the following website for an example of how the game works: http://www.websudoku.com/.

Your program will work as follows:
  1. Read a 9x9 board configuration from a file. Following are several examples: Board 1 Board 2 Board 3. You should consider using a multidimensional array to store the data.
  2. Allow the user to fill in the empty squares. You will implement a text-based version of the game. Therefore, the user will need to specify both the square in which she would like to play as well as the number she would like to place there. For example, you might label the columns using letters (A through I) and the rows using numbers (1 through 9). That would allow a user to select a box by specifying column and row, e.g., A1.
  3. Allow the user to specify when she has completed her entries and would like to check her solution.
  4. Verify the solution by checking that each row contains all of the numbers 1-9, each column contains all of the numbers 1-9, and each 3x3 subsquare contains all of the numbers 1-9. Note that there are 9 non-overlapping subsquares. Also note that if the user has failed to fill in a particular square then her solution is incorrect.
Grading of the project will be as follows:
Points Component
15 Overall design and documentation
10 Compiles and runs
10 Correctly reads board from file
10 Correctly accepts and validates input
15 Correctly checks rows
15 Correctly checks columns
15 Correctly checks subsquares
10 Demonstration and oral responses

It is strongly recommended that you attend office hours or make an appointment to discuss the design of your program.  

Also, note that 10 points of your final score will be based on a demonstration of your program and your responses to oral questions regarding your design and implementation. Demonstrations will take place during the class period on the day that the project is due.

Due 9:40AM Wednesday September 17, 2008

  1. Complete and submit your working code. Turn in a hard copy in class and place a copy of your .java files in /home/submit/cs112-f08/username.
  2. Make sure that each function is well documented. Your documentation should specify the type and function of the input parameters and output.
  3. Run your program on a variety of inputs ensuring that all error conditions are handled correctly.
Note: No portion of your code may be copied from any other source including another text book, a web page, or another student (current or former). You must provide citations for any sources you have used in designing and implementing your program.
Sami Rollins