# ML11 - Matlab 11 Rook and Bishop Tian Gu Code:815...

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

1 Matlab 11 Rook and Bishop Tian Gu Code:815 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 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

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

View Full Document
2 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
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 / 7

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

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

View Full Document
Ask a homework question - tutors are online