{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ML13 - Matlab 13 8 Queens Tian Gu Code 815 Team partner...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Matlab 13 8 Queens Tian Gu Code: 815 Team partner: Tielong Su Chaojun Zhang Introduction In this lab, we tried to figure out “the 8 queens” problem. We used the ‘queen’ function again in the program. The key to solve this problem is to use the sum of the numbers in the chessboard to get the right solution. In this lab, we also noticed that we should consider the efficiency of the programs because many program can’t work or it takes too long to work if they are not brief enough. 8 Queens Actually, this program is not very complicate. But we should use some tricks to solve it. Here are two sides we should think about. 1. We need to put 8 queens on the chessboard. That means there is only one queen per line. And this makes queens kill all other pieces because each line is in their kill path. 2. We also need to know to get the all of solution by using program. We can use the sum of all the numbers on the chessboard to identify if there are only 8 queens on the chessboard. So the sum should be 24(8*3).
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}