Skip to content

Commit

Permalink
Add q68
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkun committed Sep 13, 2024
1 parent 0b8cb1b commit 769d06f
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ex/q068.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
;; https://4clojure.oxal.org/#/problem/068

(ns ex.q068)

(defn ans
"Problem 68, Recurring Theme"
[]
[7 6 5 4 3])
17 changes: 17 additions & 0 deletions test/ex/q068_test.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
;; https://4clojure.oxal.org/#/problem/068

(ns ex.q068-test
(:require [clojure.test :as t]
[ex.q068 :as sut]))

(defn question
[]
(loop [x 5
result []]
(if (> x 0)
(recur (dec x) (conj result (+ 2 x)))
result)))

(t/deftest test-q68
(t/testing "Problem 68, Recurring Theme"
(t/is (= (question) (sut/ans)))))

0 comments on commit 769d06f

Please sign in to comment.