Back to Projects

Sudoku

A desktop Sudoku game built in C++ with SFML, featuring a backtracking algorithm for puzzle generation and solving with multiple difficulty levels.

2024

Duration

Jan 2024

Team Size

1 people

Technologies

3+ tech

Sudoku

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
Technologies

Frontend

SFML (graphics, audio, window)

Backend

C++ (algorithms, game logic)

Database

Tools

CMakeGit
Team
  • Ismail ZAHIR
License
MIT

Free to use, modify, and distribute with attribution.

Project Tags
C++SFMLAlgorithms

More Projects

NexoWorld
2024
An AR mobile game where players explore real-world locations to earn in-app currency and complete challenges — built on a Spring Boot microservices backend with real-time location sync.
Spring BootFlutterMongoDB+5
Kolchi.ma
2024
A full-featured Moroccan e-commerce and repair marketplace connecting buyers, sellers, and service providers on a polyglot microservices platform with real-time messaging.
DotNet CoreSpring BootNestJS+6