screwtape on Nostr: I cannot say this is the easiest thing I have ever written. #lisp (defun fizzbuzz-of ...
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)))))
Published at
2024-11-17 02:26:35Event JSON
{
"id": "76be20a584d810f7be740d7d62587eac70b00be24b61f7c9563a1447f1100ab3",
"pubkey": "9e9c58006890e3e31e306e20518f236965f1d8ee97640175d74afb88769a7c4d",
"created_at": 1731810395,
"kind": 1,
"tags": [
[
"t",
"mand"
],
[
"t",
"lisp"
],
[
"t",
"mlist"
],
[
"proxy",
"https://mastodon.sdf.org/users/screwtape/statuses/113495926075576556",
"activitypub"
]
],
"content": "I cannot say this is the easiest thing I have ever written. #lisp\n(defun fizzbuzz-of (x)\n\t\t (let* ((nos (scan-range))\n\t\t\t(fizz-src (series 'fizz))\n\t\t\t(buzz-src (series 'buzz))\n\t\t\t(by3s (scan-range :from 0 :by 3))\n\t\t\t(by5s (Scan-range :from 0 :by 5))\n\t\t\t(fizzes (mask by3s))\n\t\t\t(buzzes (mask by5s))\n\t\t\t(fizz/buzzes (#Mlist (#Mand fizzes fizz-src)\n\t\t\t\t\t (#Mand buzzes buzz-src))))\n\t\t (or (collect (choose-if #'identity\n (scan (collect-nth x fizz/buzzes))))\n\t\t (list (collect-nth x nos)))))",
"sig": "f4d26df29c2595ebf64a2059ff4185f8171fc50980fe0b4506e7a44149196d2d558ef7db5a075b79dce853ff2031903db009b27f1b133c0aa5dfd4cd7d62c59a"
}