From 95be493804c3291ec5b78ec3ab5d8fb88a94750c Mon Sep 17 00:00:00 2001
From: Ramakrishnan Muthukrishnan <vu3rdd@gmail.com>
Date: Wed, 25 Aug 2010 23:47:32 +0530
Subject: [PATCH] solution to 2.20 in Scheme (DrRacket)

---
 src/sicp/ex2_44.scm | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 src/sicp/ex2_44.scm

diff --git a/src/sicp/ex2_44.scm b/src/sicp/ex2_44.scm
new file mode 100644
index 0000000..03fe5aa
--- /dev/null
+++ b/src/sicp/ex2_44.scm
@@ -0,0 +1,39 @@
+#lang scheme
+
+(require (planet soegaard/sicp:2:1/sicp))
+
+
+(define (flipped-pairs painter)
+  (let ((painter2 (beside painter (flip-vert painter))))
+    (below painter2 painter2)))
+
+(define (right-split painter n)
+  (if (= n 0)
+      painter
+      (let ((smaller (right-split painter (- n 1))))
+        (beside painter (below smaller smaller)))))
+
+(define (corner-split painter n)
+  (if (= n 0)
+      painter
+      (let ((up (up-split painter (- n 1)))
+            (right (right-split painter (- n 1))))
+        (let ((top-left (beside up up))
+              (bottom-right (below right right))
+              (corner (corner-split painter (- n 1))))
+          (beside (below painter top-left)
+                  (below bottom-right corner))))))
+
+(define (square-limit painter n)
+  (let ((quarter (corner-split painter n)))
+    (let ((half (beside (flip-horiz quarter) quarter)))
+      (below (flip-vert half) half))))
+
+(define (up-split painter n)
+  (if (= n 0)
+      painter
+      (let ((smaller (up-split painter (- n 1))))
+        (below painter (beside smaller smaller)))))
+
+
+
-- 
2.45.2