35 lines
939 B
Clojure
35 lines
939 B
Clojure
(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")
|
|
|