racket/collects/mztake/demos/sine/sine-mztake.ss
2005-08-03 19:45:21 +00:00

27 lines
741 B
Scheme

(require (lib "animation.ss" "frtime")
(lib "useful-code.ss" "mztake" "private"))
(require (lib "mztake.ss" "mztake"))
(define/bind (loc "sine.ss" 5 ) x sin-x)
(define (pick-cute-color x y)
(if (< 200 y)
(if (< 200 x) "blue" "darkblue")
(if (< 200 x) "red" "darkred")))
(define (make-cute-circle x y)
(make-circle (make-posn x y)
5
(pick-cute-color x y)))
(display-shapes
(list* (make-line (make-posn 0 200) (make-posn 400 200) "gray")
(make-line (make-posn 200 0) (make-posn 200 400) "gray")
(let ([x (+ 200 x)]
[sin-x (+ 200 (* 100 sin-x))])
(history-b 50 (changes (make-cute-circle x sin-x))))))
(set-running! (even? seconds))