Skip to content

Instantly share code, notes, and snippets.

@chase-lambert
Last active August 17, 2023 03:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chase-lambert/8743bd35d7d871782e05a91b8c8124ee to your computer and use it in GitHub Desktop.
Save chase-lambert/8743bd35d7d871782e05a91b8c8124ee to your computer and use it in GitHub Desktop.
rendezvous with cassidoo challenge: 23-08-13
(ns faulty-keeb
(:require [clojure.test :refer [deftest is]]))
(defn faulty-keeb [s]
(let [vowels #{\a \e \i \o \u \A \E \I \O \U}
vowel? (fn [c] (vowels c))]
(reduce (fn [acc c]
(if (vowel? c)
(apply str (reverse acc))
(str acc c)))
""
s)))
(deftest faulty-keeb-test
(is (= "rtsng" (faulty-keeb "string")))
(is (= "w hllrld!" (faulty-keeb "hello world!"))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment