Pat O'Sullivan Department of Mathematics and Computer Studies Mary Immaculate College, Limerick, Ireland | |||||||||
General Information Student Resources and Information Interests |
|
to yacht pu setxy 0 0 pd setxy 0 20 setxy 50 20 setxy 50 30 ;back of the boat setxy 0 30 setxy 50 150 setxy 100 30 setxy 50 30 ;the sail setxy 50 20 setxy 130 20 setxy 100 0 setxy 0 0 ;front and bottom end |
to yacht :x pu setxy 0 + :x 0 pd setxy 0+:x 20 setxy 50+:x 20 setxy 50+:x 30 ;back of the boat setxy 0+:x 30 setxy 50+:x 150 setxy 100+:x 30 setxy 50+:x 30 ;the sail setxy 50+:x 20 setxy 130+:x 20 setxy 100+:x 0 setxy 0+:x 0 ;front and bottom end |
to myacht make "x -100 repeat 200 [yacht :x wait 1 clean make "x :x+1] yacht :x ;this leaves us with a yacht on the screen after the last clean end |
to flower fd 70 lt 30 ;tilt the first triangle so that the stem doesn't go through a "petal" repeat 5[triangle rt 72] rt 30 bk 70 end |
to triangle repeat 3[fd 20 rt 120] end |
to flower :s fd 70*:s lt 30 repeat 5[triangle :s rt 72] rt 30 bk 70*:s end |
to triangle :s repeat 3[fd 20*:s rt 120] end |
to gflower make "s 0.1 repeat 20[flower :s wait 1 clean make "s :s+0.1] flower :s ;leave a flower on the screen after the last clean end |