Lanquage: Java Environment: Java 17+ Description: Terminal-based game Sudoku with random generated board, difficulity level, move validations and score saving.
- Project description
A classic Sudoku game implemented in Java runing in terminal. Players choose difficulity level, solve a randomly generated board, and in the end gets score based on:
- difficulity level
- number of mistakes
- time taken to complite the game
Scores is saved locally in the file "score.ser".
- project structure
Packages and their functions:
-
sudoku.app -> Main, sudokuGame – Starting the game, main menu
-
sudoku.controller -> SudokuBoard – representation of Sudoku board
-
sudoku.generator -> SudokuGenerator – generation a board and puzzle
-
sudoku.model -> GameController – game logic and user interaction -> Difficulty, SudokuDifficultySelector – difficulity level
-
sudoku.scoreManager -> SudokuScoreController – managing saved scores -> SudokuScoreCounter, SudokuScoreEntry – score logic
-
sudoku.solver -> SudokuSolver, SudokuCountSolutions – solving and checking a board
-
sudoku.validator -> Classes validating the correctness of moves and boards
- How to run
requirements:
- Java 17 or newest
Steps:
- compile the project (e.g, in IntelliJ or in
javac). - run the
sudoku.app.Main. - In the console, execute the command as instructed.
- Game rules
- Enter moves in the following format : [row][column] [value]
e.g.
A1 5– enters 5 in the first square of the board. - Enter
q, to end the game. - Empty squares are represented by
#.
- Result file
The results are stored in the scores.ser
file in the program's working folder.
The file is automatically created upon first launch.
- Notes
This is an educational project for learning Java programming.