{ (define LIBNAME "Show Queen") (include "head.tinc") }
The teachpack show-queen.ss
provides the
operation {(idx show-queen)}
. It implements a GUI for
exploring the n-queens problem.
The function show-queen
consumes a list of
lists of booleans that describes a board. Each of the inner
lists must have the same length as the outer list. The
true
s correspond to positions where queens are,
and the false
s correspond to empty squares. The
function returns nothing.
In the GUI window that show-queen
opens, the
red and orange dots show where the queens are. The green dot
shows where the mouse cursor is. Each queen that threatens
the green spot is shown in red, and the queens that do not
threaten the green spot are shown in orange.
{(include "foot.tinc")}