From 33445194bd7bc6198ce0dfd7b5953190fb2baf49 Mon Sep 17 00:00:00 2001 From: David Kun Date: Mon, 26 Aug 2024 19:54:40 -0400 Subject: [PATCH] Add q57 --- src/ex/q057.clj | 5 +++++ test/ex/q057_test.clj | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 src/ex/q057.clj create mode 100644 test/ex/q057_test.clj diff --git a/src/ex/q057.clj b/src/ex/q057.clj new file mode 100644 index 0000000..b83e492 --- /dev/null +++ b/src/ex/q057.clj @@ -0,0 +1,5 @@ +;; https://4clojure.oxal.org/#/problem/057 + +(ns ex.q057) + +(defn ans "Problem 57, Simple Recursion" [] [5 4 3 2 1]) \ No newline at end of file diff --git a/test/ex/q057_test.clj b/test/ex/q057_test.clj new file mode 100644 index 0000000..c6f8a73 --- /dev/null +++ b/test/ex/q057_test.clj @@ -0,0 +1,9 @@ +;; https://4clojure.oxal.org/#/problem/057 + +(ns ex.q057-test + (:require [clojure.test :as t] + [ex.q057 :as sut])) + +(t/deftest test-q57 + (t/testing "Problem 57, Simple Recursion" + (t/is (= ((fn foo [x] (when (> x 0) (conj (foo (dec x)) x))) 5) (sut/ans))))) \ No newline at end of file