Minilisp.pm/examples/euler1.lisp
MadMaurice cd769b36de Remove non standard range function
Let example define its own range function using do.
2021-04-06 22:11:52 +02:00

4 lines
198 B
Common Lisp

(defun range (start end)
(do ((lst (list) (cons i lst)) (i start (+ 1 i))) ((= i end) lst)))
(write-line (reduce + (filter (lambda (x) (or (zerop (mod x 3)) (zerop (mod x 5)))) (range 1 1000))))