]> git.rkrishnan.org Git - sicp.git/blob - src/sicp/ex2_50.clj
Solution to 4.44. A bit too verbose. Can be improved by better
[sicp.git] / src / sicp / ex2_50.clj
1 (ns sicp.ex2_50
2   (:use [clojure.test]
3         [sicp.ch2_2 :only (rotate90)]))
4
5 (defn flip-horiz [painter]
6   (transform-painter painter
7                      (make-vect 1 0)
8                      (make-vect 0 0)
9                      (make-vect 1 1)))
10
11 (defn rotate180 [painter]
12   ((repeatedly 2 rotate90) painter))
13
14 (defn rotate270 [painter]
15   ((repeatedly 3 rotate90) painter))