We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e712f18 commit 092ecc2Copy full SHA for 092ecc2
src/ex/q076.clj
@@ -0,0 +1,8 @@
1
+;; https://4clojure.oxal.org/#/problem/076
2
+
3
+(ns ex.q076)
4
5
+(defn ans
6
+ "Problem 76, Intro to Trampoline"
7
+ []
8
+ [1 3 5 7 9 11])
test/ex/q076_test.clj
@@ -0,0 +1,15 @@
+(ns ex.q076-test
+ (:require [clojure.test :as t]
+ [ex.q076 :as sut]))
+(t/deftest test-q76
+ (t/testing "Problem 76, Intro to Trampoline"
9
+ (t/is (= (letfn
10
+ [(foo [x y] #(bar (conj x y) y))
11
+ (bar [x y] (if (> (last x) 10)
12
+ x
13
+ #(foo x (+ 2 y))))]
14
+ (trampoline foo [] 1))
15
+ (sut/ans)))))
0 commit comments