diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2022-05-26 00:21:20 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2022-05-26 00:55:41 +0900 |
commit | 678ae20c110a9c775bcca8aa7f3378159efe46f4 (patch) | |
tree | f28f24628b0668f8dbdde4067abbed8a36f6f7ba /README.md | |
parent | d54fc9446d97cbecbe4825493046f8216a578737 (diff) |
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 50 |
1 files changed, 20 insertions, 30 deletions
@@ -1,39 +1,29 @@ -# pict-sexp -Draw sexp. +# pict-cons +Draw cons. -![fib.png](https://raw.githubusercontent.com/wiki/tojoqk/pict-sexp/images/fib.png) +![example1.png](https://files.tojo.tokyo/pict-cons/example1.png) # INSTALL -``` -raco pkg install https://github.com/tojoqk/pict-sexp.git -``` + + raco pkg install https://github.com/tojoqk/pict-cons.git # UPDATE -``` -raco pkg update https://github.com/tojoqk/pict-sexp.git -```` + + raco pkg update https://github.com/tojoqk/pict-cons.git # UNINSTALL -``` -raco pkg remove pict-sexp -``` + + raco pkg remove pict-cons # USAGE -Save as "pict-fib.png". -``` -#lang racket -(require pict) -(require pict-sexp) - -(define pict-fib - (pict-sexp - '(define (fib n) - (cond - [(= n 0) 0] - [(= n 1) 1] - [else - (+ (fib (- n 1)) - (fib (- n 2)))])))) - -(send (pict->bitmap pict-fib) save-file "pict-fib.png" 'png) -``` + +Save as "pict-example.png". + + #lang racket + (require pict) + (require pict-cons) + + (define pict-example + (pict-cons '(+ a (* b c)))) + + (send (pict->bitmap pict-example) save-file "pict-example.png" 'png) |