The first chapter of the music of the game construction Sudoku

Source: Internet
Author: User

Sudoku is a long history, but also a particularly popular mathematical intelligence game, it not only has a strong interest, but also exercise our logical thinking ability, I in the "Strongest Brain" program also saw this project. Sudoku Game "Chessboard" is composed of 9,981 small squares, players require:

Players in each square, fill in 1 to 9 of any number, so that the entire chessboard of each column, each row, and each 3*3 of the small matrix in the number does not repeat.


Solution One: Randomly generate a complete legal solution, and then remove some of the numbers in the grid. The fewer numbers we delete, the simpler the game is, and the more difficult it is.


Solution two: From a 3*3 small matrix extended to the 9*9 of the large matrix, the expansion process is as follows:

(1) Initialization of a 3*3 feasible solution, as follows:


(2) A 3*3 small matrix is placed in the middle position (B5) extended to a large matrix of 9*9, the following expansion steps:


(3) The B5 is expanded by line as follows:


(4) B5 is expanded as follows by column:


(5) B4 extended B1 and B7,b6 extensions B3 and B9, the results are as follows:

Summary: How many feasible solutions. This is a question!


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.