]> git.rkrishnan.org Git - sicp.git/commitdiff
solution to 2.45 in Scheme
authorRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Wed, 25 Aug 2010 19:35:33 +0000 (01:05 +0530)
committerRamakrishnan Muthukrishnan <vu3rdd@gmail.com>
Wed, 25 Aug 2010 19:35:33 +0000 (01:05 +0530)
src/sicp/ex2_45.scm [new file with mode: 0644]

diff --git a/src/sicp/ex2_45.scm b/src/sicp/ex2_45.scm
new file mode 100644 (file)
index 0000000..87a950e
--- /dev/null
@@ -0,0 +1,15 @@
+#lang scheme
+
+(require (planet soegaard/sicp:2:1/sicp))
+
+(define (split f1 f2)
+  (lambda (painter n)
+    (if (= n 0)
+        painter
+        (let ((smaller ((split f1 f2) painter (- n 1))))
+          (f1 painter (f2 smaller smaller))))))
+
+(define right-split (split beside below))
+(define up-split (split below beside))
+
+    
\ No newline at end of file