aboutsummaryrefslogtreecommitdiff
path: root/posts
diff options
context:
space:
mode:
authorAkshay <[email protected]>2021-03-31 13:57:25 +0100
committerAkshay <[email protected]>2021-03-31 13:57:25 +0100
commit01ef5ffab82e3cfaf64dba23a970e99f67b84fdb (patch)
tree7b7c8784ccfe13ac1ec0b78fd0f1b97394f34aa2 /posts
parentad22c7ce9762fd731c693db6f2e124cbb82c1f93 (diff)
add day 15, 16 of devlog
Diffstat (limited to 'posts')
-rw-r--r--posts/SDL2_devlog.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/posts/SDL2_devlog.md b/posts/SDL2_devlog.md
index 4605b91..72aedef 100644
--- a/posts/SDL2_devlog.md
+++ b/posts/SDL2_devlog.md
@@ -5,6 +5,43 @@ on the editor. The days are listed in reverse chronological
5order, begin from the bottom, if this is your first time on 5order, begin from the bottom, if this is your first time on
6this page. 6this page.
7 7
8### Day 16
9
10The embedded lisp is coming along nicely, users can load
11a custom `rc.lisp`, which is evaluated on startup. To
12disable to grid on start, for example:
13
14```scheme
15;;; rc.lisp
16(toggle-grid)
17```
18
19Some aliases to switch between brushes:
20
21```scheme
22;;; rc.lisp
23(define (brush kind)
24 (cond
25 ((eq? kind 'f) (brush-fill))
26 ((eq? kind 'c) (brush-circle))
27 ((eq? kind 'l) (brush-line))
28 ((eq? kind 'l+) (brush-line-extend))
29 (else (brush-circle))))
30```
31
32### Day 15
33
34I began writing a standard library for the lisp, in lisp. It
35includes basic list operations: `car`, `cdr`, `null?`,
36`list`, higher order functions: `map`, `filter`, `fold`:
37
38```lisp
39(define (member? item ls)
40 (fold #f
41 (lambda (acc x) (or acc (eq? item x)))
42 ls))
43```
44
8### Day 14 45### Day 14
9 46
10I attempted a [small art 47I attempted a [small art