<commit_before>(ns alphabet-diamond.core)

(def ^:const row-template "ZYXWVUTSRQPONMLKJIHGFEDCBABCDEFGHIJKLMNOPQRSTUVWXYZ")

(defn- ucase-letter [letter]
	(int (.charAt (clojure.string/upper-case letter) 0)))

(defn- letter-range [start-letter end-letter]
  (map char (range (int start-letter) (inc (int end-letter)))))

(defn- instruction [index letter]
	[(+ 1 index) (str (char letter))])

(defn commands-for [end-letter]
	(let [letters (letter-range \A (ucase-letter end-letter))
				rows-and-letters (reverse (map-indexed (fn [index letter] (instruction index letter)) letters))]
				(into rows-and-letters (rest rows-and-letters))))

(defn row [row-instructions]
	(let [row-number (first row-instructions)
				letter (second row-instructions)
				row-letter (nth (letter-range \A (ucase-letter letter)) (- row-number 1))]
				(clojure.string/replace row-template (re-pattern (str "[^" row-letter "]")) " ")
	))

(defn diamond [letter]
	(let [commands (commands-for letter)]
		(map row commands)
		)
	)

(defn -main
  	"I don't do a whole lot ... yet."<commit_msg>Finished wiring - need to display output though<commit_after>(ns alphabet-diamond.core)

(def ^:const row-template "ZYXWVUTSRQPONMLKJIHGFEDCBABCDEFGHIJKLMNOPQRSTUVWXYZ")

(defn- ucase-letter [letter]
	(int (.charAt (clojure.string/upper-case letter) 0)))

(defn- letter-range [start-letter end-letter]
  (map char (range (int start-letter) (inc (int end-letter)))))

(defn- instruction [index letter]
	[(+ 1 index) (str (char letter))])

(defn commands-for [end-letter]
	(let [letters (letter-range \A (ucase-letter end-letter))
				rows-and-letters (reverse (map-indexed (fn [index letter] (instruction index letter)) letters))]
				(into rows-and-letters (rest rows-and-letters))))

(defn row [row-instructions]
	(let [row-number (first row-instructions)
				letter (second row-instructions)
				row-letter (nth (letter-range \A (ucase-letter letter)) (- row-number 1))]
				(clojure.string/replace row-template (re-pattern (str "[^" row-letter "]")) " ")
	))

(defn diamond [letter]
	(let [commands (commands-for letter)]
		(print (map row commands))
		)
	)

(defn -main
{'fraction_non_alphanumeric': 0.16160672582905183, 'fraction_numerical': 0.0028024287716020553, 'mean_word_length': 4.341645885286783, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1438596', 'n_tokens_mistral': 837, 'n_tokens_neox': 768, 'n_words': 199}