anchor.diff:                do
                 (dotimes (i p) (format t " *"))
                 (format t " Q")
  -              (dotimes (i (- n p)) (format t " *"))
  +              (dotimes (i (- n (1+ p))) (format t " *"))
                 (format t "~%"))
           (format t "No available positions.~%"))))
   
  
positive.code:   "Checks if this is a valid position for the next queen."
    (dotimes (i (1- k))
      (let ((qi (elt positions i)))
        (when (or (= qi k)
                (= (abs (- qi (elt positions k)))
                   (abs (- i k))))
          (return-from valid-p nil))))
    t)
  
  (defun find-positions (n)
    "Finds the valid positions."
    (let ((positions (make-array n :initial-element 0)))
      (loop for k from 0
            while (< k n)
            do
            (loop while (and (< k n) (not (valid-p k positions)))
                  do
                  (setf (elt positions k) (1+ (elt positions k))))
            (when (and (= k (1- n)) (< (elt positions k) n))
              (return-from find-positions positions))
            (if (and (< k (1- n)) (< (elt positions k) n))
  
negative.code:                 (decf k)
                  (if (< k 0)
                      (return-from find-positions nil)
                      (incf (elt positions k)))))))
    nil)
  