ΠΑΡΑΔΕΙΓΜΑΤΑ ΓΡΑΦΙΚΩΝ ΜΕ LOGO

Ψηφίδα Logo Ψηφίδα Ζωγραφική
to zita :a :x

rt 90

fd :a rt 180-:x

fd :a/cos :x

lt 180-:x

fd :a

end

zita 100 45

to seagull :x :c

lt :x/2

fd :c

lt :x

fd :c/2

bk :c/2

rt :x

bk :c

rt :x

fd :c

rt :x

fd :c/2

bk :c/2

lt :x

bk :c

lt :x/2

end

seagull 50 70

to toxo :n

repeat :n [fd 1 rt 1]

end

toxo 360

to spira :n

make "d 5

repeat :n [make "d :d+5 fd :d rt 90]

end

spira 20

to polygon :length :sides

repeat :sides [fd :length rt 360.0/:sides]

end

polygon 100 5

to sq :x

repeat 4[fd :x rt 90]

fd :x

end

to tri :x

rt 30

repeat 3[fd :x rt 120]

end

to house :x

sq :x

tri :x

lt 30

bk :x

end

house 100

to imitono

repeat 360 [setxy repcount 100*sin repcount]

end

imitono

to trigono :x

repeat 3 [fd :x rt 120]

end

to fractal :n :x

repeat :n [trigono :x fd :x/2 rt 60 trigono :x/2

make "x :x/2]

pu

home

pd

end

fractal 3 100

to fingers :a

pu fd 10 pd

rt 5

repeat 5 [fd :a rt 170 fd :a lt 170]

lt 5

pu bk 10 pd

end

fingers 100

to axes

pu ht setxy -180 -180 pd

repeat 18 [fd 20 lt 90 fd 3 bk 6 fd 3 rt 90]

bk 360 rt 90

repeat 18 [fd 20 lt 90 fd 3 bk 6 fd 3 rt 90]

bk 360 lt 90 st

end

axes

to begin

pu

setxy -250 0

pd

end

to semicircle :x :y

repeat integer 180/:y [fd :x rt :y]

fd :y

rt 180

end

to gefira :z :x :y

begin

repeat :z [semicircle :x :y]

end

gefira 3 5 4

to tree :size

if :size<4 [stop]

fd :size

lt 20

tree :size/2

rt 40

tree :size/2

lt 20

bk :size

end

tree 80

to squ :si

repeat 4 [fd :si rt 90]

end

to face

pd squ 100

pu fd 20

rt 90

fd 25

pd fd 50

pu bk 75

lt 90

fd 65

rt 90

fd 20

pd squ 15

pu fd 45

pd squ 15

pu bk 15

rt 90

fd 20

lt 45

pd squ 20

end

face

to astro :a :b :c :d

repeat :a [rt :c fd :b rt :d fd :b lt 150]

end

astro 18 62 18 152

to toxo :n

repeat :n [fd 1 rt 1]

end

to petal

repeat 2 [toxo 90 rt 90]

end

to flower

repeat 10 [petal rt 36]

end

to plant

flower

back 150

petal

back 50

end

plant

to tunnel :c

ask [turtle1] [curv :c]

end

to curv :c

setxy -:c*30 0

make "x -:c*30

repeat :c*60+1 [setxy :x -1/(:c*30)*:x*:x+:c*30

wait 1

make "x :x+1]

setxy 0 0

end

to lory :a :b

ask [turtle2] [truc :a :b]

end

to truc :a :b

rt 90

fd (:a/2)*30 lt 90 fd :b*30 lt 90

fd :a*30 lt 90

fd :b*30 lt 90 fd (:a/2)*30 lt 90

end

tunnel 4.5

lory 3.5 2.5