             ]
         (println )
         (let [
-          keep-words      (filter #(guess-matches? % clue) word-list) ]
+          keep-words      (filter #(keep-word? % clue #{} ) word-list) ]
             (print "clue: " (format-clue clue) "  ")
             (show-info "keep-words" keep-words)
             (if (= 1 (count keep-words))

  "cat" "car" "can" "cob" "con" "cop" "cup" 
  "work" "love" "hate" "jobs" "able" "ball" ] )

(defn guess-matches?
  "Returns true if a guess matches the target word (a string). The guess value is a vector
  of the same length with elements that are either a character or nil, where nil indicates
  a wildcard that matches any character in the target word."
  [word guess]
  { :pre  [ (= (count word) (count guess)) 
            (not-any? nil? word) ]
    :post [] }
  (let [ pair-seq   (map vector guess word)  ; a sequence of pairs
         result     (every? #(or (=    (first %) (second %))
                                 (nil? (first %)) )
                      pair-seq) ]

        char-bits     (zipmap avail-chars (map #(calc-info-bits words %) avail-chars) )
        best-char     (apply max-key char-bits avail-chars) ]
    best-char ) )

(defn do-tests []

