# Commande principale: demarrer
pour new # set defaults, screen, pen et tortue init ftd [400 400] fcfg noir fcc vert levecrayon cachetortue fin pour spir repetepour [s 10 70 5] [ levecrayon fpos xycurve :s 0 baissecrayon fcc angcol :s+10*:b repetepour [t 1 360] [fpos xycurve :s :t]] fin pour xycurve :s :t donne "x 120 * (sin :s+:a*:t) + :s * (cos (:b*:t)) donne "y 120 * (cos :s+:a*:t) + :s * (sin (:b*:t)) retourne (liste :x :y) fin pour rand2 donne "a (choix [-1 1]) * choix [1 2] donne "b (choix [-1 1]) * choix [2 3 4 5 6] fin pour display # tape header title et footer values fcc blanc fpos [-190 184] etiquette "spirograph fpos [-190 -190] etiquette phrase liste "a\ b\ = :a :b fin pour angcol :theta donne "red abs 255 *cos (:theta) donne "gre abs 255 *cos (:theta + 120) donne "blu abs 255 *cos (:theta + 240) retourne phrase liste :red :gre :blu fin pour demarrer repete 12 [new rand2 display spir attends 200] fin |