I cannot say this is the easiest thing I have ever written. #lisp
(defun fizzbuzz-of (x)
(let* ((nos (scan-range))
(fizz-src (series 'fizz))
(buzz-src (series 'buzz))
(by3s (scan-range :from 0 :by 3))
(by5s (Scan-range :from 0 :by 5))
(fizzes (mask by3s))
(buzzes (mask by5s))
(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)
(#Mand buzzes buzz-src))))
(or (collect (choose-if #'identity
(scan (collect-nth x fizz/buzzes))))
(list (collect-nth x nos)))))
Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
screwlisp (screwtape@mastodon.sdf.org)'s status on Sunday, 17-Nov-2024 11:26:43 JSTscrewlisp