Pisanje programa |
|
|
|
Rješenja zadataka
- to natpis :tekst :n
repeat :n[clean setpc random 20 label :tekst rt
30 wait 100]
end
- to spirala :m :n :s
repeat :m[fd :s rt 360/:n make "s :s+5]
end
- to pravokutnik :a :b
repeat 2[fd :a rt 90 fd :b rt 90]
end
to ljestve :a :b :n
repeat :n [pravokutnik :a :b pu fd :a pd]
end
- to kvadrat :a
setpc random 15
repeat 4[fd :a rt 90]
end
to red :n :a
repeat :n[kvadrat :a pu rt 90 fd :a lt 90 pd]
end
- to pravokutnik :a :b
repeat 2[fd :a rt 90 fd :b rt 90]
end
to red :n :a :b
repeat :n[pravokutnik :a :b pu rt 90 fd :b lt 90
pd]
end
to zid :m :n :a :b
repeat :m[red :n :a :b pu rt 90 bk :b*:n lt 90
fd :a pd ]
end
- to racun :x :y
make "zbroj :x+:y
make "razlika :x-:y
make "umnozak :x*:y
make "kolicnik :x/:y
print (se "zbroj "je :zbroj)
print (se "razlika "je :razlika)
print (se "umnožak "je :umnozak)
print (se "količnik "je :kolicnik)
end
- to pogodi
print random 25
end
- to kvadrat
make "a (random 70) + 30
repeat 4[fd :a rt 90]
make "opseg 4*:a
make "povrsina :a*:a
print (se "Opseg "je :opseg)
print (se "Povrsina "je :povrsina)
end
- to krak :a
fd :a bk :a
end
to zvijezda :n :a
repeat :n[krak :a rt 360/:n make "a :a*2]
end
- to paralelogram :a :b :kut
repeat 2[fd :a rt :kut fd :b rt (180-:kut)]
end |
|
|