diff options
author | siddharth <s@ricketyspace.net> | 2021-10-03 00:13:12 -0400 |
---|---|---|
committer | siddharth <s@ricketyspace.net> | 2021-10-03 00:13:12 -0400 |
commit | a20522dc1688d7719026db84a4c7863990868d4a (patch) | |
tree | d3677b350f1dd2202a2c99a841ab1afeae4e701d /ex | |
parent | ee5c19327b177e4582491ab165343e852dfbe1d9 (diff) |
ex: do ex. 2.45
Diffstat (limited to 'ex')
-rw-r--r-- | ex/2/45.rkt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/ex/2/45.rkt b/ex/2/45.rkt new file mode 100644 index 0000000..e750455 --- /dev/null +++ b/ex/2/45.rkt @@ -0,0 +1,27 @@ +;;;; License: CC0-1.0 + +#lang racket + +(require + racket/runtime-path + sicp-pict) + +(define-runtime-path rogers-file "rogers.jpg") + +(define rogers + (bitmap->painter rogers-file)) + +(define (split left right) + (lambda (painter n) + (if (= n 0) + painter + (let ((smaller ((split left right) painter (- n 1)))) + (left painter (right smaller smaller)))))) + +(define right-split (split beside below)) + +(define up-split (split below beside)) + +;;; Racket REPL +;;; +;;; https://ricketyspace.net/sicp/2.45.jpg |