Sudoku task

Sudoku task#

We are now going to put together everything we know to write a computer program to solve a sudoku. A sudoku is a 9x9 grid, where the goal is to assign digits (from 1 to 9) to the empty cells so that every row, column, and sub-grid of size 3×3 contains exactly one instance of the digits from 1 to 9.

Partially completed 9x9 Sudoku grid with some numbers filled in and empty cells left blank. The grid is divided into nine 3x3 boxes, each outlined with a bold border. The filled cells include values like 5, 3, 1, 4, 6 in the top row; 8, 7, blank, blank, 9, 4, blank, 3 in the second row; and continues with various numbers distributed across the grid. Some rows and columns are nearly complete, while others have multiple missing values. The puzzle appears to be mid-solution and ready for a player to complete.

You can write your solution in any programming language. You can work individually or in small groups. We recommend you spend some time planning out your solution before you start implementing. If you want you could design a flow chart to represent your algorithm.

A selection of different difficulty sudokus for you to use to help develop your algorithm can be found here.

Once you have a solution, can you use your computational thinking skills to improve the speed of the algorithm?