anchor.diff:  (defvar *new-game* "#new-game")
   
   (defvar *cell-count* 9)
  +(defvar *levels*     '(:novice :intermediate :experienced))
  +(defvar *level*      (third *levels*))
   (defvar *player-1*   :human)
   (defvar *player-2*   :computer)
   
  
positive.code:   (let ((state (state x-o)))
      (dolist (row *win-rows*)
        (let ((i (position (- row (logand state row)) ; bit logic
                           #.(quote (loop :for i :below 9 :collect (s i))))))
          (when (and i (x:empty-string (cell-text i)))
            (return-from check-win-move i))))))
  
  
negative.code:              (nth (random (length x:it)) x:it))))
      (let ((prev (previous-x-o))
            (curr (x-o)))
        (x:when-it (or (check-win-move curr)                                 ; win move? (me)
                       (and (eql :novice *level*)
                            (mv (rnd '#.(loop :for i :below 9 :collect i))))
                       (check-win-move prev)                                 ; prevent win move (you)
                       (and (eql :intermediate *level*)
                            (or (mv (rnd '(1 3 5 7)))
                                (mv (rnd '(0 2 4 6 8)))))
                       ;; experienced
                       (mv 4)                                                ; center
                       (and (not (find (latest-state)
                                       '#.(list (s 0 8) (s 2 6))))           ; avoid trap
                            (mv (rnd '(0 2 6 8))))                           ; corners
                       (mv (rnd '(1 3 5 7))))                                ; rest
          (h:hset (cell-id x:it) :text curr)
          (check-win)
          (when (and (not (won))
  