rooksCheck - % % % % % % % % % % % % % % % % % % % % % % %...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% 9/16/2009 4:09 PM % Function Name: rooksCheck % Input: 1. char array - a char array containing coordinates of rooks on a % board % Output: 1. logical - true if specified board meets consrtaints, false if % it does not % % Function Description: % In 1848, Max Bezzel, a chess player, posed a problem to % mathematicians: how would one set up a chess board with 8 queens such % that no 2 queens could attack each other? In other words, how would % one place 8 objects on an 8x8 grid such that no two objects existed in % the same row, column, or diagonal? The question has been worked on % over the years by several mathematicians and, more recently, computer % scientists. % % One approach suggested by Dijkstra in 1972 was to preform a brute force % method using recursion. The gist of the idea was to place the first % queen on the board, then place another queen. If the second queen % conflicts with the first, move it, otherwise place the next queen. % % (Source: http://en.wikipedia.org/wiki/Queens_problem)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.
Ask a homework question - tutors are online