                        (assoc node :children children)))
                    node)))))))
 
+(defn get-subtree [tree option]
+  (first (filter #(= (:answer %) option) tree)))
+;; Domain logic end
+
+;; Console UI functions
 (defn print-answers [answers]
   (loop [current-answers answers
          index 1

      (catch IllegalStateException e (println "Your subject is not known to scientists, because" (.getMessage e))))))


(comment
  (print-table [:value1 :value2] [{:value1 1 :value2 2}{:value1 3 :value2 4}])
  (time (pprint (solve-tree subject-matrix)))
  (solve-tree [["f1" ["yes" "yes" "no" "no"]] ["f2" ["1" "2" "2" "—"]]] nil)

        (for [{:keys [feature answer]} tree]
          [feature answer])))

(defn find-out [tree]
  (let [chosen-option (ask-question (answers tree))
        chosen-subtree (get-subtree tree chosen-option)]
