Introduction to the Sudoku Project

Get an overview of the Sudoku game, which we will create in this chapter.

We'll cover the following

What is the game about?

We'll learn recursion and backtracking using this simple but exciting project. This chapter aims to build a solution to solve Sudoku. Sudoku is a mind puzzle game in which the player is given a partially filled 9x9 2D array or matrix. To solve the Sudoku puzzle, we need to assign digits (from 1 to 9) to fill the empty cells such that every row, column, and subgrid of size 3×33\times 3 contains exactly one instance of the digits from 1 to 9. It may sound a bit complex, but the illustration below will help clarify what we mean:

Explanation

  • Slide 1: A Sudoku board is shown with some cells prefilled. This would be the puzzle given to us and we need to write an algorithm to fill all the empty cells with the correct numbers that satisfy Sudoku's rules.

  • Slide 2: This is the solution of the Sudoku puzzle in which green cells denote the numbers filled by the Sudoku solver algorithm.

You can see the completed project below:

Please login to launch live app!

Begin by clicking on the "Click to launch app!" button above. You can click on the "Get New Puzzle" button to get a new Sudoku puzzle, and click the "Solve" button to generate the solution for the Sudoku puzzle.