ML10 - Matlab 11 Rook and Bishop Tian Gu Code:815 Team...

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

View Full Document Right Arrow Icon
1 Matlab 11 Rook and Bishop Tian Gu Code:815 Team partner: Tielong Su Introduction In this lab, first, we were still talking about the problem about queens. After we finished the problem about 4 queens in 4*4 chessboard, we discussed the 6 queens in 6*6 board and 8 queens in 8*8 board this time and got some conclusions. After that, we started to write Rook and Bishop’s functions in Matlab. These functions must show the positions of the chess pieces and the “kill path” in the chessboard. And at last we tried to write a program which could run both of them. In the Hands-on part, we set up oscilloscope to got the rise time and we calculated to prove it was correct. 6 Queens and 8 Queens– By Hand I get the solutions by hand like the chessboard above. Actually, I tried in similar way when I did these problems. I tried to put the queens row by row or column by column. After we put the first chess piece in the first row or first column. The next queen can be put in the position like how knight gets to. (The path how knight walks). We can repeat the same thing until we cannot do it any more. And then we can start at another spot and do this again. This is a quite easy way to solve this kind of problems. Chess board
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Before we start to write the functions, we set a chessboard at first. >> chessboard=ones(8) chessboard = 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Rook function We have already written some functions last time, so we tried to use the same format to get it. function
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/17/2011.

Page1 / 9

ML10 - Matlab 11 Rook and Bishop Tian Gu Code:815 Team...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online