A classic Sudoku game offering a range of game modes and preset clues. Developed using React and Redux, with all algorithms for grid generation and uniqueness checks implemented from scratch.
https://sudoku-nine-kappa.vercel.app/
-
Classic Mode: Follows traditional Sudoku rules, filling a 9x9 grid with digits from 1 to 9, ensuring each row, column, and 3x3 subgrid contains each digit once.
-
Diagonals Mode: Similar to Classic Sudoku but adds the requirement that each of the two main diagonals of the grid also contains digits from 1 to 9 once.
-
Even-Odd Mode: Like Classic Sudoku, players fill a 9x9 grid with digits from 1 to 9. However, there is an extra requirement: darker cells are for even numbers, while lighter cells are for odd numbers.
Each game mode offers four different grid sizes: 4x4, 6x6, 8x8, and 9x9.
-
Checks: Clears erroneous cells from the grid. There are at most 3 checks per game.
-
Hints: Reveals the correct value of a randomly selected empty cell. There can be up to 5 hints per game.
-
Notes: Enables users to record potential values for each cell, without limitations.
The level of difficulty is determined flexibly based on the initial number of clues present in the Sudoku grid. You can specify up to
As you solve the puzzle, you accumulate points. The base score multiplier is determined by various factors, including the grid size and the quantity of selected hints. Additionally, completing multiple boxes, rows, or columns simultaneously results in a greater contribution to the total score.
- Game Restart: Resets the grid to its initial state.
- Game Pause: Temporarily halts the game, blurring the grid in the process.
The Sudoku Grid generation can be broken down into two steps:
-
Create a fully filled grid: This step involves generating a Sudoku grid that is completely filled and represents the solution to the puzzle.
-
Elimination Of Clues: Once the fully filled grid is generated, clues are systematically eliminated to create a playable grid that will be presented to the user.
To generate the Sudoku grid, we employ a backtracking algorithm, meticulously filling each cell step by step. An optimization strategy is implemented, attempting to solve the Sudoku grid using traditional methods first. For further details, refer to the code.
After creating a fully-filled grid, begin the process of elimination. Grid clues are removed one at a time. At each step, we ensure that the puzzle maintains a unique and solvable solution. For more information, refer to the code here.
To run this project, follow these steps:
- Clone the repository to your local machine:
git clone https://github.com/ironwolf-2000/Sudoku-Games.git
- Navigate to the project directory:
cd Sudoku-Games
- Install dependencies using npm:
npm install
- Run the development server:
npm run dev
- Open your browser and visit http://localhost:5173/ to view the project.
- Online Sudoku Solver – To ensure that my grid generation algorithm produces a unique solution
- Color Palette – Color combination ideas
- Font Awesome - Free Icons
- Google Fonts - Free custom fonts
- Sudoku.com – Inspiration for the design