From 0795e7bca7d02996a8f1852218118cd82e4e5309 Mon Sep 17 00:00:00 2001 From: Tojo Date: Sun, 24 Jun 2018 12:32:39 +0900 Subject: Add INSTALL and USAGE section --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 30bd341..bfb74c0 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,28 @@ Draw sexp. ![fib.png](https://raw.githubusercontent.com/wiki/tojoqk/pict-sexp/images/fib.png) + +# INSALL +``` +raco pkg install https://github.com/tojoqk/pict-sexp.git +``` + +# 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) +``` -- cgit v1.2.3