diff options
author | Akshay <[email protected]> | 2021-03-31 13:57:25 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2021-03-31 13:57:25 +0100 |
commit | 01ef5ffab82e3cfaf64dba23a970e99f67b84fdb (patch) | |
tree | 7b7c8784ccfe13ac1ec0b78fd0f1b97394f34aa2 /posts | |
parent | ad22c7ce9762fd731c693db6f2e124cbb82c1f93 (diff) |
add day 15, 16 of devlog
Diffstat (limited to 'posts')
-rw-r--r-- | posts/SDL2_devlog.md | 37 |
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 | |||
5 | order, begin from the bottom, if this is your first time on | 5 | order, begin from the bottom, if this is your first time on |
6 | this page. | 6 | this page. |
7 | 7 | ||
8 | ### Day 16 | ||
9 | |||
10 | The embedded lisp is coming along nicely, users can load | ||
11 | a custom `rc.lisp`, which is evaluated on startup. To | ||
12 | disable to grid on start, for example: | ||
13 | |||
14 | ```scheme | ||
15 | ;;; rc.lisp | ||
16 | (toggle-grid) | ||
17 | ``` | ||
18 | |||
19 | Some 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 | |||
34 | I began writing a standard library for the lisp, in lisp. It | ||
35 | includes 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 | ||
10 | I attempted a [small art | 47 | I attempted a [small art |