$25+
FUNDAMENTALS OF ARTIFICIAL INTELLIGENCE - CS161
Programming Assignment 6 -
DO NOT CONSULT ANY OUTSIDE REFERENCES OR SOURCES FOR THIS ASSIGNMENT
The task is to write a pure LISP program to solve the N-queens problem. The
problem is to place N queens on an NxN chessboard so that no two queens are in
the same row, column, or diagonal. If you place each queen in a separate row,
then a solution can be described by giving the column numbers of each of the
queens in order by row. For example, the list (3 1 4 2) represents a solution
to the four queens problem. Your top-level function, called QUEENS, should
take a single argument N, and return a single solution to the N-Queens problem.
If there is no solution, return nil. Your algorithm must be complete. Try to
minimize the number of functions that you write, and make each one meaningful.
Be sure to check that all of your solutions are correct.