Sudoku desktop application in Java
This project was developed for the Programming 3 course at BME.
Author: Bálint Király
Sudoku, also known as Su Doku, popular form of number game. In its simplest and most common configuration, sudoku consists of a 9 × 9 grid with numbers appearing in some of the squares. The object of the puzzle is to fill the remaining squares, using all the numbers 1–9 exactly once in each row, column, and the nine 3 × 3 subgrids. Sudoku is based entirely on logic, without any arithmetic involved, and the level of difficulty is determined by the quantity and positions of the original numbers. The puzzle, however, raised interesting combinatorial problems for mathematicians, two of whom proved in 2005 that there are 6,670,903,752,021,072,936,960 possible sudoku grids. (Source)
My version of the game closely follows the original with the addition of several customizable features to enhance the player's experience.
At the beginning the Player have the option to set game modes in a menu.
There are three grid sizes:
- 6x6
- 9x9 (original)
- 12x12
Three difficulty levels are available for selection:
- easy
- normal
- hard
The chosen difficulty level affects the number of pre-filled cells in the puzzle.
Once the player has made their selections, the game board will be generated based on the chosen grid size and difficulty level. The board is ready for the player to solve.
During the game player can save the game and load it back at any time.
Make sure you have Java installed on your system.
Compile:
javac -d ./build ./src/sudoku/*.java
Run:
java -cp ./build sudoku.SudokuGame
(Please note that the .jar file might not be updated to the latest version)
You can find the .jar file in out/artifacts/java_sudoku_jar
directory.
java -jar ./out/artifacts/java_sudoku_jar/java-sudoku.jar
- Select your preferred board size (
small
,medium
,large
). - Choose the difficulty level (
easy
,normal
,hard
). - Click on
New Game
to start the game.
- Press
Cmd + L
or select File > Load from the menu bar. - Choose a previously saved game file.
The board consists of pre-filled and blank cells. Pre-filled cells are colored and cannot be edited. Fill in all blank cells with valid numbers; the game prevents entry of invalid values.
Save your game state anytime with cmd + S
or File > Save.
Load a saved game using cmd + L
or File > Load.
To start a new game, use cmd + N
or Game > New Game from the menu bar.
After completing the game, verify your solution by clicking Check Solution
at the bottom of the window.
The game will inform you if the solution is correct. If so, you can start a new game directly from the dialog box.
Cmd + N
: Create a new game.
Cmd + S
: Save the game.
Cmd + L
: Load a saved game.
Run this script to open documentation:
open ./documentation/sudoku/package-summary.html
Run this script to open class diagram:
open ./documentation/diagram.png