(define WINDOW-WIDTH 150) (define WINDOW-HEIGHT 180) (define MAX-DIAMETER 40) ; A world is a number. ; Its display is a blue disk of that size. ; show-world : world -> image (define (show-world diameter) (circle diameter "solid" "blue")) "Examples of show-world:" (show-world 1) "should be a blue dot" (show-world 20) "should be" (circle 20 "solid" "blue") ; The next world is 1 larger than this one, unless we've reached MAX-DIAMETER, ; in which case stop the timer with the current world. ; next-world : world -> world (define (next-world diameter) (cond [(< diameter MAX-DIAMETER) (+ 1 diameter)] [else (end-of-time)])) "Examples of next-world:" (next-world 23) "should be" 24 (next-world MAX-DIAMETER) "should be something special indicating the end of time" (big-bang WINDOW-WIDTH WINDOW-HEIGHT 1/2 1) (on-update-event show-world) (on-tick-event next-world)