Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pablo Revelo. Birds: to 3birds pu home pd lt 80 pu fd 250 pd setpensize 2 setpc "white st bird pu bk random 100 bird pu lt 90 fd random 40 bird ht.

Similar presentations


Presentation on theme: "Pablo Revelo. Birds: to 3birds pu home pd lt 80 pu fd 250 pd setpensize 2 setpc "white st bird pu bk random 100 bird pu lt 90 fd random 40 bird ht."— Presentation transcript:

1 Pablo Revelo

2

3

4 Birds: to 3birds pu home pd lt 80 pu fd 250 pd setpensize 2 setpc "white st bird pu bk random 100 bird pu lt 90 fd random 40 bird ht default end to bird seth 0 pd arc2 120 20 lt 100 arc2 100 20 end Seth Turns the turtle to a new absolute heading. The angle input is the heading in degrees clockwise from the positive Y-axis. Arc2 Moves the turtle along an arc (part of a circle). The arc sweeps an amount given by the angle input. The size (curvature) of the arc is based on the radius input.

5 Earthsky Background to earthsky pd rt 90 setpc "black fd 1000 pu rt 90 fd 5 setfc "green fill bk 20 setfc "blue fill end pd Sets the pen's position to "down", without changing its mode. pu Sets the pen's position to "up", without changing its mode. Setpc Sets the pen color to color, which can either be a color index or a color vector Setfc Sets the flood color to color, which can either be a color index or a color vector.

6 Grass to clump SETPENCOLOR [43 87 36] SETH 0 fd 10 bk 10 lt 10 fd 10 bk 10 lt 20 fd 10 bk 10 rt 50 fd 10 bk 10 end to grass pu home bk 50 pd repeat RANDOM 1000[clump pu setxy -500+random 1000 -500+random 500 pd] end RANDOM Outputs a uniform random integer from 0 to the range input (not including the range input). Bk Moves the turtle backward, exactly opposite to the direction that it's headed, by the specified distance, measured in turtle steps. Lt Turns the turtle counterclockwise by the specified angle, measured in degrees (1/360 of a circle).

7 House to h1 repeat 4[fd 100 rt 90] fd 100 rt 45 fd 70.71 rt 90 fd 70.71 end to h2 :size repeat 4[fd :size rt 90] fd :size rt 45 fd 70.71*:size/100 rt 90 fd 70.71*:size/100 end Rt Turns the turtle clockwise by the specified angle, measured in degrees (1/360 of a circle). Fd Moves the turtle forward in the direction that it's headed by the specified distance, measured in turtle steps.

8 Tree to tree :size if :size<4 [stop] fd :size ;draw branch lt 20 ;angle of left branch tree :size*2/3 ;left branch rt 40 ;angle of right branch tree :size*2/3 ;right branch lt 20 ;left to return bk :size ;back to return end

9 Beach to sand pd rt 90 back 100 back 200 back 100 back 50 back 20 back 10 fd 500 pu rt 45 fd 80 SETFLOODCOLOR [255 255 0] fill To sky rt 45 rt 90 fd 100 SETFLOODCOLOR [0 173 174] Fill end Fill Fills in a region of the graphics window containing the turtle and bounded by lines that have been drawn earlier.


Download ppt "Pablo Revelo. Birds: to 3birds pu home pd lt 80 pu fd 250 pd setpensize 2 setpc "white st bird pu bk random 100 bird pu lt 90 fd random 40 bird ht."

Similar presentations


Ads by Google