Urgent-help with project.

From: aref (aref982_at_yahoo-dot-com.no-spam.invalid)
Date: 02/27/05


Date: 26 Feb 2005 23:58:57 -0600

My assignment is to write 2 lisp functions to solve the n-queens for
an n by n board. One that will take in a (n), the board size as
parameter. It will return all configuartions of the n by n board i.e
(1 2 3 4 5) for board size 5. The second function is supposed to
eliminate all invalid or illegal boards. Namely, queens in the same
column, row or diagonal.

Format: You can represent a board configuration with a simple n
element list(c1 c2 c3 c4 ... cn), ci corresponds to the column
position of i-th queen inthe i-th row. For example, (1 3 2 4) would
correspond to the 4 queens
in positions (1,1) (row 1, column 1), (2,3) (row 2, column 3), (3,2)
(row 3, column 2), and (4,4) (row 4, column 4). Note that in our
representation we do not use double indexes: the i-th queen is placed
in the i-th row and its column index is ci.

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
                http://www.usenet.com



Relevant Pages

  • Re: Urgent-help with project.
    ... Namely, queens in the same ... You can represent a board configuration with a simple n ... > in the i-th row and its column index is ci. ...
    (comp.lang.lisp)
  • Re: 8-queen problem
    ... > queens on a N*N board, so that they do not hit each other). ... Place the 3rd queen on the 3rd row so that it is in a safe spot. ... If all 8 queens can be placed, print the board configuration ... C++ Faq: http://www.parashift.com/c++-faq-lite ...
    (comp.lang.cpp)