Pablo Revelo. Birds: to 3birds pu home pd lt 80 pu fd 250 pd setpensize 2 setpc white st bird pu bk...

9

Click here to load reader

Transcript of Pablo Revelo. Birds: to 3birds pu home pd lt 80 pu fd 250 pd setpensize 2 setpc white st bird pu bk...

Page 2: 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.

9 TecnoartPablo Revelo

Page 3: 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.

9 tecnoartPablo Revelo

Page 4: 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.

Birds: to 3birdspu home pdlt 80pu fd 250 pdsetpensize 2setpc "whitest birdpu bk random 100 birdpu lt 90 fd random 40 birdhtdefaultend

to birdseth 0 pdarc2 120 20 lt 100 arc2 100

20end

Seth Turns the turtle to a new absolute heading. The angle input is the heading in degrees clockwise from the positive Y-axis.

Arc2Moves 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.

Page 5: 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.

Earthsky Backgroundto earthskypdrt 90setpc "blackfd 1000purt 90fd 5setfc "greenfillbk 20setfc "bluefillend

pdSets the pen's position to "down", without changing its mode.

puSets the pen's position to "up", without changing its mode.

SetpcSets the pen color to color, which can either be a color index or a color vector

SetfcSets the flood color to color, which can either be a color index or a color vector.

Page 6: 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.

Grassto clumpSETPENCOLOR [43 87

36]SETH 0fd 10 bk 10lt 10 fd 10 bk 10lt 20 fd 10 bk 10rt 50fd 10 bk 10end

to grasspu home bk 50 pdrepeat RANDOM 1000[clump pusetxy -500+random 1000 -500+random 500

pd]end

RANDOMOutputs a uniform random integer from 0 to the range input (not including the range input).

BkMoves the turtle backward, exactly opposite to the direction that it's headed, by the specified distance, measured in turtle steps.

LtTurns the turtle counterclockwise by the specified angle, measured in degrees (1/360 of a circle).

Page 7: 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.

Houseto h1repeat 4[fd 100 rt 90]fd 100rt 45fd 70.71rt 90fd 70.71end

to h2 :sizerepeat 4[fd :size rt 90]fd :sizert 45fd 70.71*:size/100rt 90fd 70.71*:size/100end

RtTurns the turtle clockwise by the specified angle, measured in degrees (1/360 of a circle).

FdMoves the turtle forward in the direction that it's headed by the specified distance, measured in turtle steps.

Page 8: 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.

Treeto 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 returnend

Page 9: 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.

Beachto sandpdrt 90back 100back 200back 100back 50back 20back 20back 10fd 500fd 500purt 45rt 45rt 45fd 80SETFLOODCOLOR [255 255 0]fill

To skyrt 45rt 90fd 100SETFLOODCOLOR [0 173 174]Fillend

FillFills in a region of the graphics window containing the turtle and bounded by lines that have been drawn earlier.