Code covered by the BSD License  

Highlights from
Sudoku

Be the first to rate this file! 5 Downloads (last 30 days) File Size: 3.59 KB File ID: #36200
image thumbnail

Sudoku

by

 

16 Apr 2012 (Updated )

Solves sudoku puzzle. Generates all possible answers.

| Watch this File

File Information
Description

Recursively solve sudoku.
Plus using constraints to minimize wrong guess.
It solved well defined sudoku puzzles in about 3 sec in my Matlab.

To create puzzle, use syntax s{r,c}=value. for all r,c,value=1~9.
for example, s{1,4}=5;

The submission attaches two examples for demo.

To see each move during solving, comment off show(s) in the function move at line 54.

MATLAB release MATLAB 7.6 (R2008a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
20 May 2013

add recursive routine to generate all answers.

Contact us