;; --- CSU213 Fall 2006 Lecture Notes --------- ;; Copyright 2006 Viera K. Proulx ;; Lecture 3: September 11, 2006 ;; Part 1: Playing Calder ;; Building Mobiles ;; ---------------- ;; A Mobile Construction is (make-mobilething Posn Mobile) (define-struct mobilething (origin mobile)) ;; A Mobile-Construction is (make-mobile Posn Mobile) (define-struct mconstruction (origin mobile)) ;; A Mobile is one of ;; --- (make-mend Number Number Color) ;; --- (make-mstrut Number Number Mobile Number Mobile) (define-struct mend (length weight color)) (define-struct mstrut (length loffset lmobile roffst rmobile)) ;; Examples: (define redmobile (make-mend 10 6 "red")) (define greenmobile (make-mend 10 4 "green")) (define bluemobile (make-mend 40 10 "blue")) (define leftmobile (make-mstrut 30 40 redmobile 20 greenmobile)) (define mymobile (make-mstrut 20 50 leftmobile 30 bluemobile)) (define themobile (make-mconstruction (make-posn 120 20) mymobile))