diff --git a/src/cipher_analytical_machine/symbol_factories.clj b/src/cipher_analytical_machine/symbol_factories.clj new file mode 100644 index 0000000..781822f --- /dev/null +++ b/src/cipher_analytical_machine/symbol_factories.clj @@ -0,0 +1,34 @@ +(ns cipher-analytical-machine.symbol_factories + (:require [clojure.string :as cs]) + (:gen-class)) + +(defn lower-english-alphabet-factory + "Return the English alphabet with only lowercase letters" + [] + (reduce + (fn [acc val] (str acc (char val))) + "" + (range (int \a) (inc (int \z))))) + +(defn english-alphabet-factory + "Return the English alphabet with lower and upper case letters" + [] + (let [letters (lower-english-alphabet-factory)] + (str letters (cs/upper-case letters)))) + +(defn lower-ukrainian-alphabet-factory + "Return the Ukrainian alphabet with only lowercase letters" + [] + "абвгґдеєжзиіїйклмнопрстуфхцчшщьюя") + +(defn ukrainian-alphabet-factory + "Return the Ukrainian alphabet with lower and upper case letters" + [] + (let [letters (lower-ukrainian-alphabet-factory)] + (str letters (cs/upper-case letters)))) + +(defn digit-set-factory + "Return digits" + [] + "0123456789") +