% comment for queen/2
:- comment(queen/2, [
summary: "Program that solves the attacking Queens problem for
an arbitrary number of queens.",
index: ["NQueens Problem"],
args: ["Data": "List modelling initial state of queens on board.",
"Args": "Solution list of Y-coordinate of each queen on the
board."],
amode: queen(+,-),
amode: queen(-,+),
amode: queen(+,+),
resat: yes,
fail_if: "A solution cannot be found where all queens are safe
from attack by every other.",
see_also:
[queens8/1, queensN/1],
desc: html("The problem is to arrange a specified number of queens
on a chessboard such that no queen attacks any other queen
The predicate takes a list representing the initial state
of the queens on the board, with each element representing
a queen and its current Y-coordinate. If a solution is
found, a list is returned specifying the safe Y-coordinate
for each queen.")
]). % end of comment directive for queen/2
There are two pertinent predicates for document generation. The first,
?- lib(document).
document.ecl compiled traceable 83620 bytes in 0.04 seconds
Yes (0.04s cpu)
?- icompile(queen, ".").
queen.ecl compiled traceable 1432 bytes in 0.01 seconds
/examples/queen.eci generated in 0.00 seconds.
Yes (0.01s cpu)
?- eci_to_html(queen, ".", "").
Yes (0.00s cpu)