3.83333

3.8 | 6 ratings Rate this file 76 downloads (last 30 days) File Size: 5.75 KB File ID: #12096

Sudoku: ASP.NET/MATLAB

by John Kotwicki

 

30 Aug 2006 (Updated 31 Aug 2006)

No BSD License  

Web Sudoku solver, using MATLAB algorithm as a .NET component created by MATLAB Builder for .NET, wi

Download Now | Watch this File

File Information
Description

SOLVE_SUDOKU.M -- This file contains the code for solving the Sudoku board, and should be deployed as a .NET assembly. It accepts as input a 9-by-9 array, where 0 represents a blank square, and the digits 1-9 represent any initial values in the grid. The function returns the solved board, if a solution exists, and a flag indicating whether the code was successful at finding a solution. To solve the puzzle, the code uses an algorithm that makes recursive calls to the solver function after choosing one of the possible candidates for a square. If a square does not have any possible candidates, the algorithm backs up to a previous square, and tries another possible candidate there before proceeding.

SUDOKU.ASPX -- The front-end web page is an ASP.NET file that creates a 9-by-9 grid of text boxes, allowing users to enter the values for a Sudoku puzzle. After a user clicks the submit button, this code posts the data in the grid to solver.aspx.

SOLVER.ASPX -- This ASP.NET code accepts the input data from sudoku.aspx, packages it in a .NET array, and calls a method of the Sudoku object to solve the puzzle. After receiving the output in the form of a two-dimensional array, the ASP.NET code formats the array to display the solution on the screen.

For more information on solving Sudoku puzzles, check out the following reference:
Delahaye, Jean-Paul. "The Science Behind Sudoku." Scientific American June 2006: 81-83.

Note: Certain boards take longer to solve than others. It may be helpful to set the timeout for the ASP.NET page appropriately for boards that take an excessive amount of time to complete.

Required Products MATLAB Builder NE
MATLAB Compiler
MATLAB release MATLAB 7.2 (R2006a)
Other requirements Microsoft .NET Framework 1.1 (R2006a or R2006b), or 2.0 (R2006b)
Zip File Content  
Other Files sudoku.aspx,
readme.doc,
solve_sudoku.m,
solver.aspx
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (8)
15 Oct 2006 Richard Lonscak  
18 Nov 2006 basma hussien  
18 Nov 2006 Roxana Vasiliu  
21 May 2007 Daniela Macena

Hello
how I make to see the program correctly? I need to make some configuration in the Web.config or the Assemby ?

Thanks

20 Dec 2007 marutha nayakam  
17 Mar 2008 li TONY

it's ok

03 Jul 2008 Jerry Gao

Hi, I am using Visual Studio, How do I place the SOLVE_SUDOKU.M file in the solution resource manager? many thanks.

02 Oct 2009 Chamane

really nice!

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
games John Kotwicki 22 Oct 2008 08:36:08
sudoku John Kotwicki 22 Oct 2008 08:36:08
web John Kotwicki 22 Oct 2008 08:36:08
net John Kotwicki 22 Oct 2008 08:36:08
builder John Kotwicki 22 Oct 2008 08:36:08
asp John Kotwicki 22 Oct 2008 08:36:08
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com