Sudoku
A desktop Sudoku game built in C++ with SFML, featuring a backtracking algorithm for puzzle generation and solving with multiple difficulty levels.
Duration
Jan 2024
Team Size
1 people
Technologies
3+ tech

Project Overview
The Sudoku game is developed using a backtracking algorithm to generate and solve puzzles. The algorithm fills the grid with numbers from 1 to 9 randomly — if a number is valid, it moves to the next cell; if not, it backtracks to the previous cell and tries a different number. SFML provides the graphical interface with smooth rendering and immersive audio effects to enhance the gameplay experience.
Features
- ✓Classic Sudoku gameplay with an intuitive graphical interface
- ✓Backtracking algorithm for valid puzzle generation and solving
- ✓Multiple difficulty levels — suitable for casual and advanced players
- ✓Immersive audio effects for an enhanced gaming experience
- ✓Solver mode — the algorithm can automatically complete any valid puzzle
Challenges
- •Implementing a correct and efficient backtracking algorithm for puzzle generation
- •Ensuring generated puzzles have a unique solution
- •Building a responsive graphical interface with SFML's event handling loop
Solution
Implemented a recursive backtracking algorithm that fills the grid randomly and validates each placement against row, column, and box constraints. SFML handles rendering, event loops, and audio playback, keeping the game loop clean and responsive.
Architecture
Single-process desktop application. A game engine class orchestrates the SFML window, event loop, and render cycle. Separate modules handle the Sudoku grid state, backtracking solver, and UI rendering. Published as a GitHub release.
Results & Impact
- ✓Fully playable Sudoku game with smooth SFML rendering
- ✓Backtracking solver handles any valid 9×9 grid in milliseconds
- ✓Published as a downloadable GitHub release binary
Frontend
Backend
Database
Tools
- Ismail ZAHIR
Free to use, modify, and distribute with attribution.
More Projects

