Završno ponavljanje |
|
|
|
Rješenja zadataka
- to kvadrat :a
repeat 4[fd :a rt 90]
end
- to pravokutnik :a :b
repeat 2[fd :a rt 90 fd :b rt 90]
end
- to paralelogram :a :b :kut
repeat 2[fd :a rt :kut fd :b rt 180-:kut]
end
- to kvadrat :a
repeat 4[fd :a rt 90]
end
to kvadrati :n :a
repeat :n[kvadrat :a make "a :a*2]
end
- to kvadrat :a
repeat 4[fd :a rt 90]
end
to pomak :a
pu rt 90 fd :a/4 lt 90 fd :a/4 pd
end
to kvadrati2 :n :a
repeat :n[kvadrat :a pomak :a make "a :a/2]
end
- to brojevi :n
make "x 1
repeat :n[print :x make "x :x+1]
end
- to parni :n
make "x 2
pu lt 90 fd 300 rt 180
repeat :n[label :x pu fd 20 pd make "x :x+2]
end
- to krak :r :a
pu fd :r pd fd :a pu bk :a+:r pd
end
to sunce :r :n :a
setpc 6
circle :r
repeat :n[krak :r :a rt 360/:n]
end
- to kvadrat :a
repeat 4[fd :a rt 90]
end
to trokut :a
repeat 3[fd :a rt 120]
end
to lik :x :a
if :x>100 [kvadrat :a][trokut :a]
end
- to balon :r :a :n
repeat 500[if :r <10 [stop] fd :a circle :r rt
360/:n make "a :a+10 make "r :r-5]
end
- to balon2 :r :a :n
repeat 500[if :r <10 [stop] pu fd :a pd circle
:r rt 360/:n make "a :a+10 make "r :r-5 wait 30
clean]
end
- to cvijet :a
setturtle 0
setpc 0
polukruznica :a
setturtle 1
setpc 1
rt 60 polukruznica :a
setturtle 2
setpc 2
rt 120 polukruznica :a
setturtle 3
setpc 3
rt 180 polukruznica :a
setturtle 4
setpc 4
rt 240 polukruznica :a
setturtle 5
setpc 5
rt 300 polukruznica :a
end
to polukruznica :a
repeat 18[fd :a rt 10]
circle :a pu home pd
end
- to lik :a
repeat 5[trokut :a rt 72]
end
to trokut :a
repeat 3[fd :a rt 120]
end
to vjetrenjaca :a :x
repeat :x [lik :a wait 30 clean rt 360/:x]
end
- to kocka :a
perspective
repeat 4 [repeat 4 [fd :a rt 90] fd :a down 90]
end
to kockice :a :n
perspective
repeat :n [setpc random 6 kocka :a rt 90 fd :a
lt 90]
end
- to racun :r :a :b
if :r=1 [make "z :a+:b (print se "zbroj "je :z)
stop]
if :r=2 [make "r :a-:b (print se "razlika "je
:r) stop]
if :r=3 [make "u :a*:b (print se "umnožak "je
:u) stop]
if :r=4 [make "k :a/:b (print se "količnik "je
:k) stop]
print [Krivi broj!]
end
|
|
|