anchor.diff:                  ;; if every cell is compatible with the current state of columns
                   (when (every #'identity (mapcar #'car p))
                     (solve-nonogram (butlast rows)
  -                                  (mapcar #'cadr p)
  +                                  (mapcar #'cdr p)
                                     (cons row puzzle))))
                 (generate-rows (car (last rows))))))
  +
  +(defun solve-nonogram-iter (rows cols &aux res)
  +  "Alternative iterative version of SOLVE-NONOGRAM."
  +  (do* ((queue (list (cons NIL cols)) (cdr queue))
  +        (step (car queue) (car queue))) ;a pair of filled rows and a column list
  +       ((null queue) res)
  +       (if (= (length (car step)) (length rows))
  +           (push (car step) res)
  +           (setf queue 
  +             (append queue
  +               (loop for row in (generate-rows (nth (- (length rows)
  +                                                       (length (car step)))
  +                                                    rows))
  +                     for p = (partition-cols (cdr step) row)
  +                 if (every #'identity (mapcar #'car p))
  +                   collect (cons (cons row (car step))
  +                                 (mapcar #'cdr p))))))))
   
   ;; A column is represented as a list of numbers with last element possibly NIL, depending on if the last row can be filled.
   
  
positive.code:                    (union (row-defined-spots array spot binds)
                            (col-defined-spots array spot binds)
                            (sqr-defined-spots array spot binds)))))))))
  
  (defun next-undefined-spot (array &optional defined-spots (start (cons 0 0)))
    "Return the next spot of ARRAY, read from left to right and from top to bottom, that comes after START and is NIL."
  
negative.code: (defun solve-nonogram (rows cols &optional puzzle)
    "Solve the nonogram puzzle represented by the given lists of solid lengths across each row and column.
  A full cell in a solution of the puzzle will be represented by T, and an empty cell by NIL."
    (if (null rows)
        (list puzzle)
        ;; start from the last row
  