From a20522dc1688d7719026db84a4c7863990868d4a Mon Sep 17 00:00:00 2001 From: siddharth Date: Sun, 3 Oct 2021 00:13:12 -0400 Subject: ex: do ex. 2.45 --- ex/2/45.rkt | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ex/2/45.rkt 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 -- cgit v1.2.3