Minilisp.pm/t/euler1.t
2021-04-09 00:01:27 +02:00

7 lines
269 B
Turing

(plan 1)
(defun range (start end)
(do ((lst (list) (cons i lst)) (i start (+ 1 i))) ((= i end) lst)))
(let ((result (reduce + (filter (lambda (x) (or (zerop (mod x 3)) (zerop (mod x 5)))) (range 1 1000)))))
(expect "euler1 - result is 233168" (= result 233168)))