loading...

re: Daily Challenge #249 - Incremental Changes VIEW POST

FULL DISCUSSION
 

Clojure - Level 1 🌟

(ns dailyChallenge.IncrementalChange249
  (^:level1))

;; algebraic function
(defn algo [number, step, iterations]
  {:pre (>= iterations 1)}
    (+ number (* step iterations)))

(deftest test-algo
  (is (= 52 (algo 2 5 10))
  (is (= 35 (algo 17, 3, 6)))

(run-tests 'test-algo)
code of conduct - report abuse