summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ex/2/45.rkt27
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