parent
453b90d537
commit
0b368c144e
@ -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")
|
||||||
|
|
Loading…
Reference in new issue