This is a simple Sudoku solver built using Python and Pygame. The program allows users to visualize the solving process of a 9x9 Sudoku puzzle. You can also interactively solve the puzzle or check if a given puzzle has a solution.
- Visual representation of the Sudoku board.
- Ability to solve the Sudoku puzzle with a click of a button.
- Highlights solved cells in a different color.
- Displays a message if the puzzle has no solution.
- Python 3.x
- Pygame
- Clone the repository:
git clone https://github.com/joise-s-arakkal/pygame-sudoku-solver.git
cd pygame-sudoku-solver
- Install the required dependencies:
pip install pygame
- Run the game:
python3 sudoku_gui_v3.py
- A window will appear with a 9x9 Sudoku grid and a "Solve" button. Clicking the button will attempt to solve the puzzle.
- sudoku_gui_v3.py: Main file to run the Sudoku game with a GUI using Pygame.
- sudoku_utils.py: Contains the utility functions for checking the safety of a number and solving the Sudoku using backtracking.
- sudoku_config.py: Holds the board configuration and color settings.
- The Sudoku board is drawn using Pygame.
- The solve_sudoku() function uses a backtracking algorithm to solve the puzzle.
- When the "Solve" button is pressed, the board gets solved in real-time, updating the display.
This project is licensed under the MIT License - see the LICENSE file for details.