"Shaun " <shaunvon@iastate.edu> wrote in message <hpar29$q7p$1@fred.mathworks.com>...
> My first question:
> I need to create a function that "kills" like a queen. The board is an 8x8 of ones. The directions in which the queen can kills should all turn to zeroes. A number 3 should be used to depict where the queen is placed. The inputs should be row and column. And the output should be the changed board. I can't seem to figure out how to do this.
>
> My second question:
> I am then supposed to create a program which uses the queen function that prints out all the ways 8 queens can be placed on the board such that none of the queens is in the kill zone of another queen. The program should also display how many solutions it found. (There are 96 solutions, total.) The program should not take any user input. It just needs to be a regular script file.
>
> If anybody could help out with this I would greatly appreciate it. Thanks!
>
> Shaun

Yes, I remember doing that eight queens problem a number of years ago. The number of solutions I found was different from the 96 you quote. I won't take away from the enjoyment of the problem by telling how to do it. In my opinion problems like that are best appreciated if you do them entirely without anyone else's assistance, and I would advise you to try doing just that. If you succeed at this problem, you might like to solve the n x n generalization of it  you work with an n by n chess board. The program I wrote took quite a long time with a fifteen by fifteen board.
Roger Stafford
