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

2022Complete

Sudoku interface with a generated puzzle, options on the left and control toggles on the right
Playing a generated puzzle, with checking and the solver.
What it is
A Pygame app that makes Sudoku puzzles, lets you play them, checks your answers, and can solve any board one step at a time.
Why I made it
After the Cryptogram Solver, I wanted to try backtracking on a different kind of puzzle.
What I did
I wrote the puzzle generator, the play and hint modes, a way to type in your own puzzle, and a solver you can watch work.
How it turned out
It works most of the time, which is honestly part of the charm.

The details

One program, several modes

It has hints, answer checking, erasing, typing in your own board, and a solver view. The puzzle keeps track of which cells are original clues, your guesses, hints, right answers, wrong answers or solver moves, so each one can be drawn differently.

Watching the solver work

Instead of solving the whole board instantly, the backtracking solver takes one step per frame. You can watch it try a number, hit a dead end, back up, and keep going until the grid is full.