 
 ;; NOTE: All anagrams formed must be contained in the given text file.
 
-;;-------------------------------------------------------------------------------------------------------
-;; from problem_0030:
-
 (defn digits
   [n]
   (loop [n n, ds []]

             (if-let [[_ y2s] (find sq-map sds)]
               (or (->> y2s
                        (map (fn [y2] [y2 (digits y2)]))
                        (map (fn [[y2 y2ds]] [x2 y2 (make-anagram-pattern ds y2ds)]))
                        (filter (fn [[_ _ pat]] (word-patterns pat)))
                        (first)
                        )
                   (recur (dec x) (update sq-map sds #(conj % x2))))
               (recur (dec x) (assoc sq-map sds [x2]))
               )))
         ;;(first)
         )))

          q (quot n 10)
          new-ds (conj ds r)]
      (if (== q 0)
        (reverse new-ds)
        (recur q new-ds)
        ))))

(defn read-anagrams []
  (->> (str/split (slurp "resources/p098_words.txt") #",")
