Sudoku Solution for ASP.net 2.0

Source: Internet
Author: User

Sudoku game in the square of the 9x9, divided into 3x3 small squares, known as the "district."

Sudoku begins with a grid that has been filled in with numbers.

The goal of Sudoku is to fill spaces with numbers between 1 and 9 according to the following rules:

Each number can appear only once per row, in each column, and in each area.

I implemented a Sudoku solution on the Linux server (see "Running asp.net 2.0 under Linux") with ASP.net 2.0.

Http://www.sudoku.name website also has a very good user interface "Sudoku", but its algorithm is too bad, the operation speed than my algorithm is much slower. Taking the "#5328" puzzle on its Web site (which is also an example of my Sudoku Solver), it takes about four hours to give an answer, and my solver can give an answer in less than a second. From its calculation process, it is estimated that the solution is a space. And my algorithm is to first find the number of digits can be filled with the least number of spaces to solve. This small improvement of the algorithm greatly improves the computational efficiency. Okay, cut the crap, the following is the source program:

1. Sudoku.aspx:

1<%@ Page language= "C #" inherits= "Skyiv.Ben.Web.SudokuPage"%>
2<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transition Al.dtd ""
3 4 5 <title > Galaxy-Sudoku </title>
6 7<body>
8 <form id= "Form1" runat= "Server"
9 < Asp:button text= "return" onclick= "Btnurihome_click" runat= "Server"/>
Ten <asp:button text= "Start" onclick= " btnSubmit_Click "runat=" server/>
one <div>
<a href= index-cn.php "target=" "_blank" > Sudoku game </a>
14 in the square of the 9x9, divided into 3x3 small squares, known as "District". <BR/>
15 Sudoku The first game begins with a grid that has already been populated with numbers. <BR/> The purpose of the
16 Sudoku game is to fill spaces with numbers between 1 and 9 according to the following rules: <br/>
http://www.knowsky.com Each number can appear only once per row, in each column, and in each area. <BR/>
</div>
<div>
<asp:textbox runat= "Server" Id= "Tbxinput" maxlength= "" "wrap=" False "
textmode=" MultiLine "columns=" "rows=" "/>
<asp:text Box runat= "Server" id= "Tbxoutput" readonly= "True" wrap= "False"
textmode= "MultiLine" columns= "" "Rows="/> "
</div>
</form>
26</body>
27

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.