               clue            (make-clue tgt-word guessed-chars) 
             ]
         (println )
-        (let [
-          keep-words      (filter #(keep-word? % clue guessed-chars ) word-list) ]
-            (print "clue: " clue "  ")
-            (show-info "keep-words" keep-words)
-            (if (= 1 (count keep-words))
-              (let [final-guess (str/join (first keep-words)) ]
-                (println (str "***** found word:  '" final-guess "'  *****") )
-                (println "matches:" (= final-guess tgt-word)) )
-            ;else
-              (let [new-guess       (make-guess keep-words guessed-chars)
-                    guessed-chars   (conj guessed-chars new-guess)
-                    new-clue        (make-clue tgt-word guessed-chars)
-              ]
-                (println "  new-guess" new-guess 
-                  "  guessed-chars (" (count guessed-chars) ")" guessed-chars)
-                (when (some #(= \- %) new-clue)
-                  (recur  (conj guessed-chars new-guess)  new-clue ) )
-              )
+        (let [ keep-words (filter-words clue guessed-chars word-list) ]
+          (print "clue: " clue "  ")
+          (show-info "keep-words" keep-words)
+          (if (= 1 (count keep-words))
+            (let [final-guess (str/join (first keep-words)) ]
+              (println (str "***** found word:  '" final-guess "'  *****") )
+              (println "matches:" (= final-guess tgt-word)) )
+          ;else
+            (let [new-guess       (make-guess keep-words guessed-chars)
+                  guessed-chars   (conj guessed-chars new-guess)
+                  new-clue        (make-clue tgt-word guessed-chars)
+            ]
+              (println "  new-guess" new-guess 
+                "  guessed-chars (" (count guessed-chars) ")" guessed-chars)
+              (when (some #(= \- %) new-clue)
+                (recur  (conj guessed-chars new-guess)  new-clue ) )
             )
+          )
         ))
 
   ))

    (assert (not (re-find (re-pattern patt-str) "xxxd" )))

    ; Test if keep word
    (assert      (keep-word? "abcd" "----"  #{}      )  )
    (assert      (keep-word? "abcd" "abcd"  #{}      )  )
    (assert      (keep-word? "abcd" "a---"  #{}      )  )
    (assert      (keep-word? "abcd" "ab--"  #{}      )  )
    (assert      (keep-word? "abcd" "-b--"  #{\b \s} )  )
    (assert (not (keep-word? "abcd" "a---"  #{\b \s} ) ))

  )
  (let [tst-words       [ "abcd" "xbcd" "xxcd" "xxxd" ] 
        words-map       (group-by count tst-words)
        word-list       (words-map 4)
        clue            "-b--"
        keep-words      (filter #(keep-word? % clue #{\b} ) word-list)
  ]
    (assert (= words-map   {4 ["abcd" "xbcd" "xxcd" "xxxd"]} ))
    (assert (= word-list      ["abcd" "xbcd" "xxcd" "xxxd"]  ))
    (assert (= keep-words     ["abcd" "xbcd"]                ))
  )
)


                       (if (= clue-ch \-) not-guessed-class clue-ch) ))
    ] patt-str ))

(defn filter-words 
  "Filter words retaining only those that are possible matches given the current clue and
  already guessed chars."
  [clue guessed-chars words]
  (let [patt-str      (clue-to-regex clue guessed-chars) 
        re-patt       (re-pattern patt-str)
        keep-words    (filter #(re-find re-patt %) words ) ]
    keep-words ))

(defn make-guess-1
  "Choose the most numerous letter"
  [words used-chars]
  (let [avail-chars   (set/difference all-letters used-chars)
        char-freqs    (frequencies (str/join words))
        best-char     (apply max-key #(get char-freqs % -1) avail-chars) ]
    best-char ))

(defn make-guess
  [words used-chars]
  (make-guess-1 words used-chars) )

(defn do-tests []

  ; Test regex stuff
  (assert (= (complement-char-class #{})         "."      ))
