Wave 4: add sequences/vectors/files chapters, 23 exercises, quiz3, finish ceremony, PCL table

This commit is contained in:
venomade committed 2026-11-22 11:15:35 +00:00
1 parent 77843402fa
commit 4675bd1106
76 files changed
+2505 -14

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
;;; RECURSION 5: MUTUAL RECURSION (solution)
(defun my-evenp (n)
(labels ((even-step (k)
(if (zerop k)
t
(odd-step (1- k))))
(odd-step (k)
(if (zerop k)
nil
(even-step (1- k)))))
(even-step n)))
;;; ------------------------------------------------------------------
;;; Checks. Read them - they tell you what to aim for - but leave
;;; them unchanged.
;;; ------------------------------------------------------------------
(check (my-evenp 0))
(check (my-evenp 4))
(check (not (my-evenp 7)))
(check (not (my-evenp 1)))