The Little Schemer is a book teaching you to think recursively. The way to use it is to read a question, think about the question, and come up with an answer.
The Vivid Schemer turns the Q&As in black and white into a live conversation on the screen, which can guide you to think in the right path.
If you are not yet familiar with Scheme, use this guide.
You can also embed the Vivid Schemer in your web page.
Tweet
Don't worry if you didn't know very much about Scheme. Learning only a small part of it is enough to play with The Vivid Schemer.
| Example | Semantics |
|---|---|
| 17 | 17 is a number. |
| (quote (yesterday once more)) | Return the (yesterday once more) literally without evaluating it. |
| (cond ((< 2 1) #t) (else #f)) | Ask the first question (< 2 1). If the answer is true, evaluate the expression #t. Otherwise, ask the second question else. Else is always true, so return the value of evaluating #f. |
| (define square (lambda (x) (* x x))) | Define a new variable square and give it the value of evaluating the expression (lambda (x) (* x x))). |
| (lambda (r) (* 3.14 (* r r))) | Create a function with a parameter named r and the expression (* 3.14 (* r r))) as body. |
| (begin (...) (...)) | Evaluate expressions in left-to-right order, and return the final value. |
| (square 12) | Call a function named square with 12 as the parameter. |
Insert your code and press generate, then copy the generated code to your site.