Sitemap
Play With Python

Learn Python and programming through fun and games.

Member-only story

Sudoku

17 min readJan 4, 2026

--

Press enter or click to view image in full size
Our Sudoku Game
Our Sudoku Game

I enjoy puzzles. One of my favorites is Sudoku.

In this project, we will generate Sudoku puzzles and provide a nice user interface for solving them. We will rate the puzzles by difficulty and allow the player to choose how tough they want the puzzle to be.

Sudoku players often use a pencil to mark up the squares with the possible numbers that can legally be in the square. This makes the hard puzzles easier to solve. Our program will have the option of doing the markup for you.

Going further, we will add two more aids. We will show the singletons (squares where only one digit is legal). For simple puzzles, this makes the solving trivial, as you just enter the singleton in that square, and doing this repeatedly opens up more singletons, until you have solved the puzzle. But for harder puzzles, we can benefit from more analysis.

For these puzzles, we have yet another aid, called smart markup. This uses some of the more common Sudoku strategies, reducing the number of markups. While this still won’t make the painful puzzles trivial, it helps a lot.

Hardcore Sudoku addicts will scoff at these aids, but for people just learning how to solve the puzzles, they can be enlightening.

--

--

Simon Quellen Field
Simon Quellen Field

Written by Simon Quellen Field⁠

Simon Quellen Field is a science writer and novelist currently experimenting with shorter works. Find his books at scitoys.com/books or his website scitoys.com.

Play With Python
Play With Python

Published in Play With Python

Learn Python and programming through fun and games.