Skip to content

Commit

Permalink
Add q57
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkun committed Aug 26, 2024
1 parent 627ece9 commit 3344519
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ex/q057.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
;; https://4clojure.oxal.org/#/problem/057

(ns ex.q057)

(defn ans "Problem 57, Simple Recursion" [] [5 4 3 2 1])
9 changes: 9 additions & 0 deletions test/ex/q057_test.clj
Original file line number Diff line number Diff line change
@@ -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)))))

0 comments on commit 3344519

Please sign in to comment.