; your code goes here
(defun match (pattern string)
  (let ((i 0)
        (len (length string))
        star)
    (loop
       for c across pattern
       do
         (when (= i len)
           (return-from match))
         (case c
           (#\* (setf star t))
           (#\? (incf i))
           (otherwise (if star
                          (loop while (and (< i len) (not (eql c (elt string i))))
                             do (incf i)
                             finally (incf i) (setf star nil))
                          (if (eql c (elt string i))
                              (incf i)
                              (return-from match))))))
     (= i len)))

(loop :for (s r) :on '("aababbcd" t
                       "abcd" nil
                       "aa?bxcxd" nil) :by #'cddr
   :for x := (match "a?*bb*cd" s) :do
   (format t "~:[FAIL~;OK~] ~:S: expected ~:[false~;true~]~%" (eql r x) s r))
