Skip to main content

previous disabled Page of 2
and
  1. No Access

    Book

  2. No Access

    Chapter

    Abbreviations and Acronyms

    ANSI

    Giulio Zambon in Sudoku Programming with C (2015)

  3. No Access

    Chapter

    Implementing “Backtrack”

    As I have already explained in Chapter 2, backtracking is a nice way of saying “guessing.” When you exhaust all strategies you know, you can only pick a cell that you haven’t yet solved and try out one of its ...

    Giulio Zambon in Sudoku Programming with C (2015)

  4. No Access

    Chapter

    Modeling a Sudoku Puzzle in C

    The purpose of this book is to teach you how to write computer programs to solve and generate Sudoku puzzles.

    Giulio Zambon in Sudoku Programming with C (2015)

  5. No Access

    Chapter

    Special Sudokus

    Now that you know how to generate standard Sudoku puzzles, it is time to learn how to make some special ones.

    Giulio Zambon in Sudoku Programming with C (2015)

  6. No Access

    Chapter

    Implementing “Naked” Strategies

    The three naked strategies, naked pair, naked triple, and naked quad, work on the same general principle: unit by unit, first make a list of all the cells containing naked multiples (i.e., pairs, triples, or q...

    Giulio Zambon in Sudoku Programming with C (2015)

  7. No Access

    Chapter

    Development Environment

    I developed the Solver and the Generator on a Macintosh, but from the very start I wanted to be certain that they were portable to Windows-based PCs. That is why I chose Eclipse as an Integrated Development En...

    Giulio Zambon in Sudoku Programming with C (2015)

  8. No Access

    Chapter

    Implementing “Box-Line”

    As with most strategies, you implement “box-line” with two functions: one general that conforms to the type f_ptr_t as defined in def.h and one to handle an individual unit. The general function, box_line() (see ...

    Giulio Zambon in Sudoku Programming with C (2015)

  9. No Access

    Chapter

    Implementing “Lines” Strategies

    As I already said in Chapter 2, the lines strategies rely on parallel rows and columns. You can implement all lines strategies with three small functions named lines_2(), lines_3(), and lines_4() (see the respect...

    Giulio Zambon in Sudoku Programming with C (2015)

  10. No Access

    Chapter

    Implementing “Y-wing”

    The Y-wing strategy is quite complex, which is reflected in the complexity of its implementation.

    Giulio Zambon in Sudoku Programming with C (2015)

  11. No Access

    Chapter

    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...

    Giulio Zambon in Sudoku Programming with C (2015)

  12. No Access

    Chapter

    Solving Thousands of Puzzles

    The Solver program accepts a Sudoku string as an argument. This is OK when you want to solve a few Sudokus, but it is completely inadequate when you want to obtain statistical data on solving puzzles. For that...

    Giulio Zambon in Sudoku Programming with C (2015)

  13. No Access

    Chapter

    The Strategies

    Not all strategies are created equal. When solving a Sudoku puzzle manually it makes sense to use simpler strategies as long as they result in candidate removals and cell solutions, and only then move to more ...

    Giulio Zambon in Sudoku Programming with C (2015)

  14. No Access

    Chapter

    Puzzle Statistics and More Puzzles

    According to Wikipedia, the total number of possible solved Sudokus is a staggering 6,670,903,752,021,072,936,960 ( http://en.wikipedia.org/wiki/Sudoku

    Giulio Zambon in Sudoku Programming with C (2015)

  15. No Access

    Chapter

    Implementing “Unique”

    The “unique” strategy looks for candidates that are unique within a unit. This happens when all other candidates for the same number are removed from the unit (see Figure 4-1).

    Giulio Zambon in Sudoku Programming with C (2015)

  16. No Access

    Chapter

    Implementing “Hidden” Strategies

    The two “hidden” strategies, hidden pair and hidden triple, have the same general design: first, they build lists of the cells containing each candidate number; then, they analyze the lists to see whether pair...

    Giulio Zambon in Sudoku Programming with C (2015)

  17. No Access

    Chapter

    Implementing “Pointing Line”

    As I explained in Chapter 2, pointing-line is similar to box-line in that they both look at the intersection of a line with a box. Therefore, it is not surprising that the implementations of the two strategies...

    Giulio Zambon in Sudoku Programming with C (2015)

  18. No Access

    Chapter

    Implementing “XY-chain”

    This strategy is an extension of Y-wing. Therefore, it is not surprising that the two strategies share a significant amount of code.

    Giulio Zambon in Sudoku Programming with C (2015)

  19. No Access

    Chapter

    Generating Sudokus

    To generate a valid Sudoku puzzle you have to go through the following two steps: generate a completed Sudoku and remove numbers from it in such a way that only one solution is possible with the clues that are...

    Giulio Zambon in Sudoku Programming with C (2015)

  20. No Access

    Chapter

    The Solver Program

    The main program, sudoku_solver.c, accepts the Sudoku to be solved, performs some checks, solves the Sudoku, and presents the final result. It is the module that binds together all the various functions of the pr...

    Giulio Zambon in Sudoku Programming with C (2015)

previous disabled Page of 2