This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Matlab 12 Queen Function Tian Gu Code: 815 Team partner: Tielong Su Introduction Last week I finished the rook function, but the bishop part did not work perfectly. I thought I was using the brief way, but the only thing I couldn’t figure out were the ranges. This lab was about the queen function. We can say it is just a combination the rook function and the bishop function. Before we solved this, we must make sure the bishop part can work well. So with my partner, I focused on the rest part of the bishop (about the ranges). And finally we got it perfectly and it was very brief. Then we used the queen function in a program to let users play. Queen Function Last time I got this questionable bishop function below, function [chessBoard] = Bishop(c,d); [chessBoard] = ones(8) for x=-2:2 (the part we should fix) chessBoard(c+x,d+x)=0; (we should also these parts because it affect what the range is) end for y=-2:2 (the part we should fix) chessBoard(c-y,d+y)=0; end chessBoard(c,d)=3 end I mentioned I couldn’t get the right ranges, here I just put a small range here to make sure it can work. Now we should think about the right ranges which could make it run anytime. We thought about maybe we could do some adjustments to make the function in four quadrants, so this makes ranges much easier to get. Now we should use four “for ” sentences....
View Full Document
This document was uploaded on 11/17/2011.
- Fall '09