anchor.diff:        (rotatef (aref temp-state i) (aref temp-state j))
         temp-state)))
   
  -(defun move-blank (state direction)
  +(defun move-blank (state direction pos-0)
     (declare (special *width*))
  -  (cons (case direction
  -          (UP
  -           (let ((i (position 0 state))
  -                 (j (- (position 0 state) *width*)))
  -             (when (>= j 0)
  -               (swap state i j))))
  -          (DOWN
  -           (let ((i (position 0 state))
  -                 (j (+ (position 0 state) *width*)))
  -             (when (< j (length state))
  -               (swap state i j))))
  -          (LEFT
  -           (let ((i (position 0 state))
  -                 (j (1- (position 0 state))))
  -             (unless (zerop (mod i *width*))
  -               (swap state i j))))
  -          (RIGHT
  -           (let ((i (position 0 state))
  -                 (j (1+ (position 0 state))))
  -             (unless (zerop (mod (1+ i) *width*))
  -               (swap state i j)))))
  -        direction))
  +  (case direction
  +    (UP
  +     (let ((new-pos-0 (- pos-0 *width*)))
  +       (when (>= new-pos-0 0)
  +         (vector (swap state pos-0 new-pos-0) direction new-pos-0))))
  +    (DOWN
  +     (let ((new-pos-0 (+ pos-0 *width*)))
  +       (when (< new-pos-0 (length state))
  +         (vector (swap state pos-0 new-pos-0) direction new-pos-0))))
  +    (LEFT
  +     (let ((new-pos-0 (1- pos-0)))
  +       (unless (zerop (mod pos-0 *width*))
  +         (vector (swap state pos-0 new-pos-0) direction new-pos-0))))
  +    (RIGHT
  +     (let ((new-pos-0 (1+ pos-0)))
  +       (unless (zerop (mod (1+ pos-0) *width*))
  +         (vector (swap state pos-0 new-pos-0) direction new-pos-0))))))
   
   (defparameter *width* 3)
   
  
positive.code: 
  (format t "IDA*-search~%")
  (time (format t "~A~%" (n-puzzle #'IDA*-search
                                   #'manhattan
                                   *start*)))
  
  (format t "A*-search~%")
  (time (format t "~A~%" (n-puzzle #'A*-search
                                   #'manhattan
                                   *start*)))
  
negative.code: (defun goalp (node)
    (equalp node *target*))
  
  (defun action (node)
    ;; return a list of '(state direction pos-0)
    (let ((old-state (node-state node))
          (old-direction (node-direction node))
          (old-pos-0 (node-pos-0 node)))
    (remove nil
            (mapcar (lambda (direction)
                      (move-blank old-state direction old-pos-0))
                    (remove (case old-direction
                              (UP 'DOWN)
                              (DOWN 'UP)
                              (RIGHT 'LEFT)
                              (LEFT 'RIGHT))
                            '(UP DOWN RIGHT LEFT))))))
  
  
  (defun n-puzzle (search heuristic initial-state)
  