1 (defun make-position (row col)
3 (defun position-row (pos)
5 (defun position-col (pos)
7 (defun positions-equal (a b)
9 (defvar empty-board '())
10 (defun adjoin-position (row col positions)
11 (append positions (list (make-position row col))))
13 (let ((a-row (position-row a))
14 (a-col (position-col a))
15 (b-row (position-row b))
16 (b-col (position-col b)))
20 ((= (abs (- a-col b-col))
21 (abs (- a-row b-row))) t)
23 (defun safe? (k positions)
24 (let ((kth-pos (nth (1- k) positions)))
27 (and (not (positions-equal kth-pos pos))
28 (attacks? kth-pos pos)))