anchor.diff:         (find-vertex graph destination-key)))))
   
   (defmethod send ((game game) message &rest rest)
  -  (apply #'send (slot-value game 'fsm) message rest))
  +  (apply #'send (slot-value game 'fsm) message rest)
  +  game)
   
   (defgeneric add-player (game name)
     (:method ((game game) (name string))
  
positive.code: (defgeneric reset-movable-armies (game)
    (:method ((game game))
     (loop for territory being the hash-values in (territories game) do
           (setf (movable-armies territory) (1- (armies territory))))))
  
  (defgeneric move-armies (game from to amount)
    (:method ((game game) origin-key destination-key amount)
  
negative.code:                     (:setup (:done :placing-twice-n)
                       :placing-twice-n
                       (:place :placing-twice-n
                        :done ((fsm)
                               (when (eq (rotate-turn game) (head-player game))
                                 (switch fsm :placing-n))))
                       :placing-n
                       (:place :placing-n
                        :done ((fsm)
                               (when (eq (rotate-turn game) (head-player game))
                                 (reset-movable-armies game) 
                                 (switch fsm :attacking))))
                       :attacking
                       (:attack ((fsm from to)
                                 (attack game from to))
                        :done ((fsm)
                               (switch fsm :regrouping)))
                       :regrouping
                       (:move ((fsm from to amount)
                               (move-armies game from to amount))
                        :done ((fsm)
                               (switch fsm (if (pass-turn game)
                                             :placing
                                             :attacking))))
                       :placing
                       (:place :placing
                        :done ((fsm)
                               (when (eq (rotate-turn game) (head-player game))
                                 (switch fsm :attacking)))))
                      :setup))))
  
  (defgeneric read-map (file)
    (:method ((list list))
     (let* ((territories (make-hash-table :test 'equalp))
            (frontiers (make-container 'graph-container)))
       (dolist (territory (getf list :territories))
         (destructuring-bind (key name extra-armies terr-frontiers) territory
           (add-vertex frontiers key)
           (setf (gethash key territories)
                 (make-instance 'territory
                                :name name
                                :extra-armies extra-armies))
           (dolist (frontierkey terr-frontiers)
             (add-edge-between-vertexes frontiers key frontierkey))))
       (make-instance 'game-map :territories territories :frontiers frontiers)))
  
    (:method ((file stream))
     (let* ((*read-eval* nil))
       (read-map (read file))))
  
    (:method ((path pathname))
     (with-open-file (file path) (read-map file)))
  
    (:method ((path string))
     (read-map
       (parse-namestring
         (if (probe-file path)
           path
           (format nil "~a.map" path))))))
  
  (defgeneric read-game (file)
    (:method ((list list))
     (let ((game (make-instance 'game
                                :game-map (read-map (getf list :game-map))
                                :players (getf list :players))))
       (loop for (name armies-dist) on (getf list :armies) by #'cddr do
             (loop for (territory-key armies) on armies-dist by #'cddr
                   for territory = (territory game territory-key) do
                   (setf (owner territory) (player game name))
                   (setf (armies territory) armies)))
       ; TODO: signal error on uninitialized territories
       game))
  
    (:method ((file stream))
     (let ((*read-eval* nil))
       (read-game (read file))))
  
    (:method ((path pathname))
     (with-open-file (file path) (read-game file)))
  
    (:method ((path string))
     (read-game
       (parse-namestring
         (if (probe-file path)
           path
           (format nil "~a.save" path))))))
  
  (defgeneric territory (container key)
    (:method ((container game-map) key)
  