;;; Fichier spiro.s / 28 fevrier 2000 ;;; d'apres Tim Hickey : spirograph.jsc ;;; http://www.cs.brandeis.edu/~tim/Packages/Jscheme/latest/demos/spirograph.jsc (define b (button "Vas-y!")) (add b appletwin) (validate appletwin) (define sam (turtle 100 100 appletwin)) (define (Baction) (penup sam) (goto (+ 100 (* (random) 150)) (+ 100 (* (random) 150)) sam) (pendown sam) (draw-spirograph 30 (+ 50 (* (random) 130)) 100 sam)) (refresh appletwin) (addCallback b Baction appletwin) (define (draw-spirograph n angle x tortue) (sleep 100) (go x tortue) (turn angle tortue) (if (> n 0) (draw-spirograph (- n 1) angle x tortue) 'fin))