Sudoku solveur/generator

Versione 1.0.0.0 (20,3 KB) da Julien
Generate a full grid, pick off cases, display possibilities in each case, solve a sudoku
1,2K download
Aggiornato 12 feb 2010

Visualizza la licenza

This program was written as a student project, the comments in the .m and the commands of the interface are in french, sorry for that.

Here is a summary of the main functions :

- generate a full grid - it fills the 1st row with a randperm(9), then fills the 1st 3x3 square in the same way (of course the first row of this square is already filled), finally it fills the grid case by case with a random() on the list of the possibilities of each case (this is the big picture)

- pick off cases - the user chooses how many cases have to be empty, the prog picks off cases randomly but make sure that the sudoku as a unique solution and is symmetrical

- solve sudoku - it uses a lot of methods described on the internet but basically it makes a list of elect numbers in each case, then shorten this list and fill the cases where there is only 1 possibility. I use a simple backtracking algo to solve the sudoku when the previous techniques don't work (but most of the time the backtracking is used only on a very few number of undetermined cases).

It also can display the possibilities of each cases (the numbers which are in red or purple are sure and grey one only a possibility).

Please notice that in the interface you have to use the RIGHT button on your mouse to run a command, the left one is only used to get the help of the said function.

I hope a made myself clear, i can answer any further questions.

Cita come

Julien (2025). Sudoku solveur/generator (https://it.mathworks.com/matlabcentral/fileexchange/26655-sudoku-solveur-generator), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2007b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Sudoku in Help Center e MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0