CHAPTER 12

image

Implementing “Rectangle”

The rectangle strategy is the first level 3 strategy that is not an extension of easier ones. As I explained in Chapter 2, this strategy relies on sets of cells that form rectangular patterns. You implement it with the functions rectangle(), rectangle_pattern(), rectangle_cell(), and rectangle_step() (see Listings 12-1, 12-2, 12-3, and 12-4, respectively).

rectangle()

To program the rectangle strategy, you need to check all possible rectangular patterns of cells and follow the chain around the four boxes that contain the corners of the patterns.

Only the following nine combinations of four boxes are possible: ...

Get Sudoku Programming with C 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.