🎉 Welcome to the Sudoku Solver Visualizer! 🎉 This web-based app lets you visualize the solving process using backtracking. Features include 🔀 random puzzle generation, ⏩ variable solving speeds, and ✨ visual effects to celebrate a solved puzzle. Enjoy a fun and interactive Sudoku-solving experience!
- Features
- Technology Stack
- Getting Started
- Web Application
- Usage
- Code Overview
- Contributing
- License
- Contact
- Links
- 🔢 Live Input Feedback: Receive real-time feedback as you input numbers into the Sudoku grid.
- 🎨 Interactive UI: Engage with an intuitive and visually appealing user interface designed for ease of use.
- 👌 Good UX: Enjoy a seamless user experience with smooth interactions and clear instructions.
- ⚡ Fast Backtracking Algorithm: Solve Sudoku puzzles quickly and efficiently using an optimized backtracking algorithm.
- 🌐 Cross-Platform: Access the Sudoku visualizer on both web and mobile platforms for convenience.
- 🛠️ Customizable Settings: Tailor the visualization settings to your preferences, including solving speed and difficulty level.
- 📚 Learn Mode: Understand the backtracking process step-by-step with an educational mode that explains each move when speed set to Xtra slow.
- Web browser (Google Chrome, Firefox, Safari, etc.)
-
Clone the repository:
git clone https://github.com/vansh-codes/Sudoku-Visualizer.git
-
Navigate to the project directory:
cd sudoku-visualizer
-
Open
index.html
in your web browser to start using the application.
- Access here: Sudoku-Visualizer
- Clear Board: Click the "Clear" button to clear the Sudoku board.
- Generate Board: Click the "Generate Board" button to generate a new random Sudoku puzzle.
- Solve: Click the "Solve" button to start solving the puzzle using the selected algorithm and speed.
- Select Speed: Choose the speed of the solving animation from the dropdown menu (Fast, Medium, Slow, Extra Slow).
- Select Algorithm: Choose the algorithm for solving the puzzle from the dropdown menu (currently supports Backtracking).
- Enjoy the Visual Effects: Upon solving the puzzle, enjoy the fireworks effect celebrating your success.
subMenu
: Refers to the submenu element inside the navigation bar.speedButton
: Refers to the button for selecting speed inside the navigation bar.speedDropDown
: Holds the current selected speed.speedOptions
: List of all available speed options.confetti
: Configures the confetti for celebrating the solved puzzle.algorithmsDropDown
: Holds the current selected algorithm.algorithmsOptions
: List of all available algorithm options.
Defines the different speeds for the solving animation:
FAST_SPEED
: 0.4 secondsMEDIUM_SPEED
: 10 secondsSLOW_SPEED
: 50 seconds
clear.addEventListener('click', clickedClear)
: Clears the board.randomlyFill.addEventListener('click', clickedRandomlyFill)
: Fills the board with a random puzzle.solve.addEventListener('click', clickedSolve)
: Starts solving the puzzle.
clickedClear(e)
: Clears the board and resets the state.clickedRandomlyFill(e)
: Clears the board and fills it with a random puzzle.clickedSolve(e)
: Starts the solving process.solveByBacktracking(algo)
: Solves the puzzle using the Backtracking algorithm.backtracking(matrix, algo)
: Initializes and runs the backtracking algorithm.backtrackingHelper(matrix, isFixed, i, j, data, algo)
: Recursively solves the puzzle using backtracking.
getFixedEntries(matrix)
: Returns an array indicating which entries are fixed.canBeCorrect(matrix, i, j)
: Checks if the current state of the board is valid.allBoardNonZero(matrix)
: Checks if all cells in the board are filled.readValue()
: Reads the current values from the Sudoku board.
Contributions are welcome! Please fork the repository and submit a pull request for any enhancements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for details.
For any questions or feedback, please contact vansh-codes.
Show some ❤️ by starring this repository !