There must be a main window menu bar containing the following menu items:

  • Exit: kills the application
  • About: pops up a dialogue that tells something about the developer of the application (you) and some information about the application: number of classes, number of methods, total number of lines of code.

Sudoku

The overall goal of the project is to implement an application that enables a kid to play the popular Sudoku game. Here we consider a simplified Sudoku board with 4 boxes of 4 cells each (the regular one is composed of nine boxes of 9 cells). So, in total a 4x4 grid of digits. The objective is to fill a 44 grid with digits so that each column, each row, and each of the four 22 sub-grids that compose the grid (also called "boxes", "blocks", "regions", or "subsquares") contains all of the digits from 1 to 4.

The following one is an example of a game and its (unique) solution.

Store in a file a set of Sudoku games (10 games), i.e., partially completed grids. Note that a well-posed game has a unique solution. Each game can be stored in 4 lines of text: each line represents a box of the Sudoku game (upper left, upper right, lower left, lower right). Each square is represented by 4 digits between 0 and 4, where 0 means that the corresponding cell is empty (and it should be guessed by the user). For instance the line 0 4 3 0 in the file represents a square

When the application is starting it asks the nickname of the user.

The nickname of the user is then shown in the user interface.

After the application is loaded the user should be enabled to choose to play one of the Sudoku games stored in the file. The games are numbered from 1 to #games in the file. The games are marked as new, done or tried. New games have not been previously tried by the user. Done games have been already tried and successfully solved. Tried games have been tried but not solved.

Use a convenient component to let the user select to play one of the games stored in the file and that shows what are new, tried or done. The user can play any game, irrespectively of the state of the game.

When a game is selected for playing the user can start solving the Sudoku. When the user makes the first action on the game a timer starts counting the execution time. The timer is shown in the interface.

The cells that have already a number (given in the game definition) cannot be modified. The user can fill only the cells that in the game definition in the file have number 0 and are shown empty in the game visualization.

The user can in each empty cell add the list of compatible numbers for the cell (i.e., those compatible with the game constraints). They are shown in the upper part of the cell (in a smaller font).

The list of possible numbers can be edited by the user and changed when he likes. He can eventually remove all of them.

The user can enter a number (between 1 and 4) in the cell as his solution for the cell. He can also modify a number entered previously.

The user can click on a button to reset the game to the initial state (discard all previously entered numbers and compatible numbers).

When the user has entered all his solution numbers in the empty cells he can press a button (Check it) that will stop the timer and check the correctness of the solution. An additional effect of pressing the Check it button is also that the current game is marked as tried in the file storing the games, if it is not correctly solved, or it is marked done if it is correctly solved.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.