Skip to content
Michael Lizzio

Sudoku Creator and Solver

A Pygame Sudoku app that generates, plays, checks, and solves puzzles

  • Python
  • Pygame
  • Backtracking algorithm
  • Puzzle generation

Complete

Sudoku interface with a generated puzzle, options on the left and control toggles on the right
The original Pygame interface for playing, checking, and solving a generated Sudoku.

After building the Cryptogram Solver, I wanted to use backtracking on another kind of puzzle. This Pygame app can generate Sudoku boards, let you play them, accept a puzzle you enter yourself, and solve the board one step at a time. It mostly works most of the time, which is part of the charm of revisiting it now.

One program, several modes

The interface includes hints, answer checking, erasing, board entry, and a solver view. The generated puzzle keeps track of which cells are original clues, player guesses, hints, correct answers, wrong answers, or solver moves so each kind can be displayed differently.

Watching the solver work

Instead of solving the whole board instantly, the backtracking routine advances one action per frame. You can watch it try a value, reach a dead end, move backward, and continue until it fills the grid.