Escalating multi-paragraph hints (wave 3, F2)
info.sexp :hint now accepts a string or a list of paragraph strings; normalize-hint converts entries at load and fails fast on malformed ones (lisplings: Bad :hint for <name> ...). In watch mode h reveals one paragraph per press and revealed hints stay pinned on the screen, resetting when the exercise changes; hint [name] prints every paragraph numbered. intro1, functions3 and quiz1 are converted to paragraph lists as examples; every other entry keeps working as a plain string.
This commit is contained in:
1 parent
516b256ea3
commit
04e313a915
3 files changed
+40
-20
No files matched your search
@@ -3,7 +3,8 @@
|
||||
;;; Read by the lisplings runner. Each exercise is a plist:
|
||||
;;; :name the exercise name; file is exercises/<dir>/<name>.lisp
|
||||
;;; :dir the chapter directory
|
||||
;;; :hint shown by `lisplings hint <name>'
|
||||
;;; :hint one hint paragraph, or a list of them; watch mode reveals
|
||||
;;; one per `h', `lisplings hint <name>' prints them all
|
||||
|
||||
((:welcome "Welcome to Lisplings!
|
||||
|
||||
@@ -30,7 +31,7 @@ Found an issue, or want to add an exercise? Improvements welcome!")
|
||||
(:exercises
|
||||
((:name "intro1"
|
||||
:dir "00_intro"
|
||||
:hint "This exercise has no errors. Play with the banner, save the file, and press n in the terminal. You might need to press ENTER after typing n.")
|
||||
:hint ("This exercise has no errors. Play with the banner, save the file, and press n in the terminal. You might need to press ENTER after typing n."))
|
||||
(:name "intro2"
|
||||
:dir "00_intro"
|
||||
:hint "The format directive ~a expects a value from the arguments after the format string. The string below has no arguments at all...")
|
||||
@@ -51,7 +52,9 @@ Found an issue, or want to add an exercise? Improvements welcome!")
|
||||
:hint "Match the parameter list to the calls: average is called with TWO numbers here. And (- a b) subtracts b from a - check which way round you wrote it.")
|
||||
(:name "functions3"
|
||||
:dir "02_functions"
|
||||
:hint "&OPTIONAL gives a parameter a default: (defun repeat-word (word &optional (n 2)) ...). For the box, a keyword default may use an earlier parameter: (defun make-box (width &key (height width) (depth width)) ...).")
|
||||
:hint ("&OPTIONAL gives a parameter a default: (defun repeat-word (word &optional (n 2)) ...)."
|
||||
"A keyword default may use an earlier parameter: (defun make-box (width &key (height width) (depth width)) ...)."
|
||||
"Further reading: CLHS 3.4.1 (ordinary lambda lists) and PCL ch. 5, https://gigamonkeys.com/book/functions.html"))
|
||||
(:name "functions4"
|
||||
:dir "02_functions"
|
||||
:hint "FLOOR returns two values at once: (floor 10 3) is 3 and 1. Pass it straight through. For 125 seconds: (floor seconds 60) is 2 minutes and 5 seconds.")
|
||||
@@ -234,7 +237,8 @@ Found an issue, or want to add an exercise? Improvements welcome!")
|
||||
:hint "MULTIPLE-VALUE-BIND on GETHASH: if PRESENT return the value, otherwise compute, SETF the table, return. The second call must not touch SLOW-FIB again.")
|
||||
(:name "quiz1"
|
||||
:dir "quizzes"
|
||||
:hint "APPEND makes a new book with the contact at the end. DOLIST + STRING-EQUAL + GETF finds by name; FORMAT makes the card.")
|
||||
:hint ("APPEND makes a new book with the contact at the end."
|
||||
"DOLIST + STRING-EQUAL + GETF finds by name; FORMAT makes the card."))
|
||||
(:name "quiz2"
|
||||
:dir "quizzes"
|
||||
:hint "A COND over three shapes: numbers, quote forms, and operator forms. MEMBER (car expr) '(+ - *) recognizes the operators; APPLY + MAPCAR evaluates the arguments."))))
|
||||
Reference in new issue
Block a user