From f390400c2ea0f12d0c27594d97422818f1596a31 Mon Sep 17 00:00:00 2001 From: David Kun Date: Wed, 4 Sep 2024 20:31:10 -0400 Subject: [PATCH] Add q64 --- src/ex/q064.clj | 8 ++++++++ test/ex/q064_test.clj | 11 +++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/ex/q064.clj create mode 100644 test/ex/q064_test.clj diff --git a/src/ex/q064.clj b/src/ex/q064.clj new file mode 100644 index 0000000..d2ad1a9 --- /dev/null +++ b/src/ex/q064.clj @@ -0,0 +1,8 @@ +;; https://4clojure.oxal.org/#/problem/064 + +(ns ex.q064) + +(defn ans + "Problem 64, Intro to Reduce" + [] + +) \ No newline at end of file diff --git a/test/ex/q064_test.clj b/test/ex/q064_test.clj new file mode 100644 index 0000000..c6407f0 --- /dev/null +++ b/test/ex/q064_test.clj @@ -0,0 +1,11 @@ +;; https://4clojure.oxal.org/#/problem/064 + +(ns ex.q064-test + (:require [clojure.test :as t] + [ex.q064 :as sut])) + +(t/deftest test-q64 + (t/testing "Problem 64, Intro to Reduce" + (t/is (= 15 (reduce (sut/ans) [1 2 3 4 5]))) + (t/is (= 0 (reduce (sut/ans) []))) + (t/is (= 6 (reduce (sut/ans) 1 [2 3]))))) \ No newline at end of file