Urgent-help with project.
From: aref (aref982_at_yahoo-dot-com.no-spam.invalid)
Date: 02/27/05
- Next message: John DeSoi: "Re: pgEdit - PostgreSQL editor created with Lisp"
- Previous message: Peter Scott: "Re: pgEdit - PostgreSQL editor created with Lisp"
- Next in thread: Tim Josling: "Re: Urgent-help with project."
- Reply: Tim Josling: "Re: Urgent-help with project."
- Reply: Frank Buss: "Re: Urgent-help with project."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: John DeSoi: "Re: pgEdit - PostgreSQL editor created with Lisp"
- Previous message: Peter Scott: "Re: pgEdit - PostgreSQL editor created with Lisp"
- Next in thread: Tim Josling: "Re: Urgent-help with project."
- Reply: Tim Josling: "Re: Urgent-help with project."
- Reply: Frank Buss: "Re: Urgent-help with project."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|