

You can use this by iterating through each cell of the grid and populating it with certain number. The backtracking algorithm can be used to generate a Sudoku puzzle. There are many approaches/algorithms for generating or solving a Sudoku puzzle. In order to generate a puzzle you (your application) have to solve it first, so in a sense generating a puzzle is like a solving a certain puzzle. When building a Sudoku game, perhaps the most fundamental thing is to generate the puzzle, afterward you'll just have to wait for the player to solve it.

There are a bunch of sites, forums, blogs completely dedicated to Sudoku and things about it. I was very surprised how much stuff about Sudoku one can find on the Net. The player has to fill a partially filled 9x9 grid which consists of nine 3x3 boxes or blocks so that each number from 1 to 9 appears only once in each column, row and box. Sudoku is a logic game, there are pretty well definition and details on Wikipedia for the game. It sounds like a story so far ain't it :), yet this post is intended to be a showcase of some approaches and algorithms for creating a Sudoku puzzles and games. you know "Set the Controls for the Heart of the Sun", find out more about it, reach for its "essence", build an algorithm or two and then do a bit of coding. No, seriously, it has some strange positive influence on your (or mine at least) logic, maybe because there is so much logic in it.


Try making a short Sudoku-solving break every time you're coding something, in a short time you'll find algorithms leaking out of your brains, and coding faster than you've ever had :). I traveled a lot, about three hours one-way at least twice a month, and it was a real pleasure "not" to waste my time just staring in the moving environment, although even that can be fun sometimes, but it gets a bit dull after the first couple of trips and then it simply makes you asleep :)įew months ago I got obsessed with it, again, I've started solving Sudoku puzzles in a specialized Sudoku magazines (daily newspapers puzzles weren't enough anymore), and it's become a real office mind-stimulating treatment. I first came in contact with Sudoku a few years ago, back when I was a student.
