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? ChristianReceived 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