Minilisp.pm/t/euler1.t

6 lines
259 B
Perl
Raw Normal View History

2021-04-06 22:41:49 +02:00
(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)))