Wave 4: add sequences/vectors/files chapters, 23 exercises, quiz3, finish ceremony, PCL table
This commit is contained in:
1 parent
77843402fa
commit
4675bd1106
76 files changed
+2505
-14
No files matched your search
@@ -0,0 +1,19 @@
|
||||
;;; STRINGS 6: FORMAT PICKS AND CASE (solution)
|
||||
|
||||
(defun tick-tock (n)
|
||||
(format nil "~[tick~;tock~]" (mod n 2)))
|
||||
|
||||
(defun quiet-title (s)
|
||||
(format nil "~(~a~)" s))
|
||||
|
||||
;;; ------------------------------------------------------------------
|
||||
;;; Checks. Read them - they tell you what to aim for - but leave
|
||||
;;; them unchanged.
|
||||
;;; ------------------------------------------------------------------
|
||||
|
||||
(check-equal "tick" (tick-tock 0))
|
||||
(check-equal "tock" (tick-tock 1))
|
||||
(check-equal "tick" (tick-tock 2))
|
||||
(check-equal "tock" (tick-tock 5))
|
||||
(check-equal "grace" (quiet-title "GRACE"))
|
||||
(check-equal "ada lovelace" (quiet-title "ADA LOVELACE"))
|
||||
Reference in new issue
Block a user