The sudoku generator

A generator developed especially for our website

The sudoku grids generator of Foxy Sudoku has been developed especially for our website. We do not depend on a third-party software to create our grids, and we can therefore make it evolve as we please.

Big players of sudoku ourselves, we have been a little bit disappointed by softwares and mainstream magazines, where sudokus stated expert or diabolical can be resolved in ten minutes with basic techniques. However there are some very good generators, but generally when it comes to play, ergonomics is awful.

On Foxy Sudoku, we try to bring together the best of both worlds. On one side, a generator able to create quality grids, interesting to play regardless of your level. On the other side, a playing comfort at least equals to the best sudoku softwares.

Back to top

How our sudokus are generated ?

The first step consists of generating the solution of the sudoku, namely a square grid of 9 x 9 cells respecting the sudoku rules, where every number is present only once by row, column and region.

Next we randomly take a cell in the grid, erase its value, then we pass the modified grid to our step by step solver to check if it is able to solve it. If yes, we repeat the process with another cell. Otherwise, we put back the erased value in its cell, and we try with another one. When we can't empty cells anymore, the generation is over and we save the grid.

You would have understood it, the solver plays a central role in the grid generation. It ensures us that the content of a cell can be erased while keeping a sudoku which can be logically resolved by a human. Thus it is the main vector to enhance the generator. Indeed, the more we « teach » it solving techniques, the more the generated sudokus will have a high difficulty.

Back to top

How our solver works ?

In order to solve a sudoku grid, the solver has at its disposal a list of solving techniques with growing difficulties. This order is necessarily subjective, everybody being more comfortable with certain techniques. Beginning with the easiest technique, the solver scans the grid to see if it is usable. If the grid offers no opportunity to use it, the solver tries the following technique on the list, and so on until it finds a usable one. The technique is then used and this process repeats until the grid is resolved or it ends due to lack of technique to continue.

The order of utilization of the techniques by the solver is as follows :

Back to top

Difficulty of generated grids

It is not possible to predict the difficulty level of generated sudokus. This level is calculated a posteriori using the method described belows. Grids with a high diffulty level are the most uncommon.

Our sudokus are classified in six difficulty levels : beginner, easy, medium, hard, expert and diabolical.

To determine the difficulty level of a grid, we assign it four notes.

The first note, on six points, is determined by the level of the hardest technique used to solve the grid :

Note Technique
1 pt Naked single, hidden single
2 pts Naked pair, naked triple, pointing pairs, box line reduction
3 pts Hidden pair, hidden triple, naked quad, hidden quad
4 pts X-Wing, XY-Wing, simple colouring, Swordfish, XYZ-Wing
5 pts Jellyfish, unique rectangle
6 pts -

The second note, on two points, is determined by the number of candidate elimination techniques (techniques that don't allow us to directly put a number in a cell) used to solve the grid. Eight or more elimination techniques bring two points. Between four and eight, one point. Otherwise, zero.

It has to be noted that this number of utilization is weighted by a coefficient that is inversely proportional to the total number of opportunities of using the technique. For instance, if the grid needs to use a X-Wing to be solved, and if more than one distinct X-Wing allow to continue the resolution, then the use of this X-Wing brings less than one point. This behavior is also applicable to the next note.

The third note, on one point, is determined by the number of utilization of techniques graded level four or more (with reference to the table of the first note) needed to solve the grid. If this number of utilization is greater than or equal to three, it brings one point. Otherwise, zero.

The fourth and last note, on one point too, is determined by the number of distinct techniques graded level four or more needed to solve the grid. If this number is greater than or equal to three, it brings one point. Otherwise, zero.

Putted end to end, these four notes allow us to determine the difficulty level of the grid as follows :

Difficulty Notes
Beginner 1000
Easy 2000
Medium 2100, 2200, 3000, 3100, 3200
Hard 4*** where the sum *** is lower than or equal to 2/4
Expert 4*** where the sum *** is greater than or equal to à 3/4
5*** where the sum *** is lower than or equal to à 2/4
Diabolical 5*** where the sum *** is greater than or equal to à 3/4
6***

Back to top

Loading