The n-queens problem

From: masdeval <masdeval_at_yahoo.com.br>
Date: Tue 10 Aug 2004 01:37:00 PM GMT
Message-ID: <061d01c47edf$1fae7430$2806520a@cbraz>
    Hi all, 

    i'am trying to understand the n-queens program below 

    :- lib(ic).
queens_lists(N, Board) :- 

 length(Board, N),
 Board :: 1..N, 
 ( fromto(Board, [Q1|Cols], Cols, []) do
  ( foreach(Q2, Cols), param(Q1), count(Dist,1,_)
     do Q2 #\= Q1, Q2 - Q1 #\= Dist, Q1 - Q2 #\= Dist
    )),
    labeling(Board). 
    

    but i can't one thing:  why the output is only a list with four numbers? Shouldn't be four pairs 
    indicating the line and column in the board for each queen?

    Christian 
       
Received on Tue Aug 10 15:31:50 2004

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:29 PM GMT GMT