summaryrefslogtreecommitdiffstats
path: root/clojure/raindrops/src
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2021-09-05 22:23:54 +0530
committerAndinus <andinus@nand.sh>2021-09-05 22:23:54 +0530
commitfec4b82917ccb41362c3170e1b71f9dbf98fb997 (patch)
tree5a9a44dc62fd4e4566a6f963c734d8724de64611 /clojure/raindrops/src
parent670546b8a284bee51f63f00dabcf89b9ea463e68 (diff)
downloadexercism-fec4b82917ccb41362c3170e1b71f9dbf98fb997.tar.gz
Clojure: Raindrops: Add solution
Diffstat (limited to 'clojure/raindrops/src')
-rw-r--r--clojure/raindrops/src/raindrops.clj15
1 files changed, 15 insertions, 0 deletions
diff --git a/clojure/raindrops/src/raindrops.clj b/clojure/raindrops/src/raindrops.clj
new file mode 100644
index 0000000..8815f2d
--- /dev/null
+++ b/clojure/raindrops/src/raindrops.clj
@@ -0,0 +1,15 @@
+(ns raindrops)
+
+(defn convert [number]
+ (def drops "")
+
+ (if (== (mod number 3) 0)
+ (def drops (str drops "Pling")))
+ (if (== (mod number 5) 0)
+ (def drops (str drops "Plang")))
+ (if (== (mod number 7) 0)
+ (def drops (str drops "Plong")))
+
+ (if (= drops "")
+ (def drops (str number)))
+ drops)