© Moritz Lenz 2020
M. LenzRaku Fundamentals https://doi.org/10.1007/978-1-4842-6109-5_3

3. Formatting a Sudoku Puzzle

Moritz Lenz1 
(1)
Fürth, Bayern, Germany
 

As a gentle introduction to Raku, let’s consider a small task that I recently encountered while pursuing one of my hobbies.

Sudoku is a number placement puzzle played on a grid of 9×9 cells, subdivided into blocks of 3×3 (Figure 3-1). Some of the cells are filled out with numbers from 1 to 9; some are empty. The objective of the game is to fill out the empty cells so that in each row, column, and 3×3 block, each digit from 1 to 9 occurs exactly once.
../images/449994_2_En_3_Chapter/449994_2_En_3_Fig1_HTML.jpg
Figure 3-1

A Sudoku puzzle in its unsolved form ...

Get Raku Fundamentals: A Primer with Examples, Projects, and Case Studies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.