This commit is contained in:
Miloslav Ciz 2024-09-05 21:54:17 +02:00
parent b7dd8b6448
commit 9c9ff9934c
21 changed files with 1828 additions and 1769 deletions

25
lisp.md
View file

@ -96,4 +96,29 @@ Here is a small cheatsheet:
(mainLoop)
```
And here is [fizzbuzz](fizzbuzz.md):
```
(define (divisible a b)
(zero? (remainder a b)))
(define (fizzBuzz from to)
(if (divisible from 3)
(display "Fizz"))
(if (divisible from 5)
(display "Buzz"))
(if (not (or (divisible from 3) (divisible from 5)))
(display from))
(if (< from to)
(begin
(display ", ")
(fizzBuzz (1+ from) to))))
(fizzBuzz 1 100)
(display "\n")
```
TODO: the basic two-function definition of Lisp