         m)))
 
 (defun pick-monster ()
-  (fresh-line)
-  (princ "Monster #:")
+  (newline)
+  (insert "Monster #:")
   (let ((x (read)))
     (if (not (and (integerp x) (>= x 1) (<= x *monster-num*)))
-        (progn (princ "That is not a valid monster number.")
+        (progn (insert "That is not a valid monster number.")
                (pick-monster))
         (let ((m (aref *monsters* (1- x))))
           (if (monster-dead m)
-              (progn (princ "That monster is alread dead.")
+              (progn (insert "That monster is alread dead.")
                      (pick-monster))
               m)))))
 

  (<= *player-health* 0))

(defun show-player ()
  (fresh-line)
  (princ "You are a valiant knight with a health of ")
  (princ *player-health*)
  (princ ", an agility of ")
  (princ *player-agility*)
  (princ ", and a strength of ")
  (princ *player-strength*))

(defun player-attack ()
  (fresh-line)
  (princ "Attack style: [s]tab [d]ouble swing [r]oundhouse:")
  (case (read)
    (s (monster-hit (pick-monster)
                    (+ 2 (randval (ash *player-strength* -1)))))
    (d (let ((x (randval (truncate (/ *player-strength* 6)))))
         (princ "Your double swing has a strength of ")
         (princ x)
         (fresh-line)
         (monster-hit (pick-monster) x)
         (unless (monsters-dead)
           (monster-hit (pick-monster) x))))

(defun monster-dead (m)
  (<= (monster-health m) 0))
(defun monsters-dead ()
  (every 'monster-dead *monsters*))

(defun show-monsters ()
  (newline)
  (insert "Your foes:")
  (let ((x 0))
    (map 'list
         (lambda (m)
             (newline)
             (insert "    ")
             (insert (incf x))
             (insert ". ")
             (if (monster-dead m)
                 (insert "**dead**")
                 (progn (insert "(Health=")
                         (insert (monster-health m))
                         (insert ") ")
                         (monster-show m))))
         *monsters*)))

(defclass monster nil ((health (randval 10))))

(defmethod monster-hit (m x)
  (decf (monster-health m) x)
  (if (monster-dead m)
      (progn (insert "You killed the ")
             (insert (type-of m))
             (insert "! "))
      (progn (insert "You hit the ")
             (insert (type-of m))
             (insert ", knocking off ")
             (insert x)
             (insert " health points! "))))

(defmethod monster-show (m)
  (insert "A fierce ")
  (insert (type-of m)))

(defmethod monster-attack (m))

(defclass orc (monster) ((club-level (randval 8))))
(push 'make-orc *monster-builders*)

(defmethod monster-show ((m orc))
  (insert "A wicked orc with a level ")
  (insert (orc-club-level m))
  (insert " club"))

(defmethod monster-attack ((m orc))
  (let ((x (randval (orc-club-level m))))
       (insert "An orc swings his club at you and knocks off ")
       (insert x)
       (insert " of your health points. ")
       (decf *player-health* x)))

(defclass hydra (monster) ())
(push 'make-hydra *monster-builders*)

(defmethod monster-show ((m hydra))
  (insert "A malicious hydra with ")
  (insert (monster-health m))
  (insert " heads."))

(defmethod monster-hit ((m hydra) x)
  (decf (monster-health m) x)
  (if (monster-dead m)
      (insert "The corpse of the fully decapitated and decapacitated hydra
falls to the floor!")
      (progn (insert "You lop off ")
              (insert x)
              (insert " of the hydra's heads! "))))

(defmethod monster-attack ((m hydra))
  (let ((x (randval (ash (monster-health m) -1))))
    (insert "A hydra attacks you with ")
    (insert x)
    (insert " of its heads! It also grows back one more head! ")
    (incf (monster-health m))
    (decf *player-health* x)))

(defclass slime-mold (monster) ((sliminess (randval 5))))
(push 'make-slime-mold *monster-builders*)

(defmethod monster-show ((m slime-mold))
  (insert "A slime mold with a sliminess of ")
  (insert (slime-mold-sliminess m)))

(defmethod monster-attack ((m slime-mold))
  (let ((x (randval (slime-mold-sliminess m))))
       (insert "A slime mold wraps around your legs and decreases your agility
by ")
       (insert x)
       (insert "! ")
       (decf *player-agility* x)
       (when (zerop (random 2))
         (insert "It also squirts in your face, taking away a health point! ")
         (decf *player-health*))))

(defclass brigand (monster) ())
(push 'make-brigand *monster-builders*)

(defmethod monster-attack ((m brigand))
  (let ((x (max *player-health* *player-agility* *player-strength*)))
    (cond ((= x *player-health*)
           (insert "A brigand hits you with his slingshot, taking off 2 health
points! ")
           (decf *player-health* 2))
          ((= x *player-agility*)
           (insert "A brigand catches your leg with his whip, taking off 2
agility points! ")
           (decf *player-agility* 2))
          ((= x *player-strength*)
           (insert "A brigand cuts your arm with his whip, taking off 2
strength points! ")
           (decf *player-strength* 2)))))

