Vianoce s robotnackou
From RoboWiki
Obrazky robene imaginom
VLOCKA
to vlocka :r :d :u if :u >=1 [repeat :r [fd :d vlocka :r :d/3 :u-1 pu bk :d pd if :u=1 [fd :d*2/3 lt 45 fd :d/3 pu bk :d/3 pd rt 90 fd :d/3 pu bk :d/3 lt 45 bk :d*2/3 pd ] lt 360/:r ] ]
r - koľko "cípa je vločka"
d - základná dĺžka vločky
u - hustota vločky
Odporúčam zadať: vlocka 8 150 2
STROM
to strom :d :n fd :d repeat :n[lt 90 fd :d rt 135 fd sqrt(:d*:d*2) lt 45] lt 180 repeat :n[lt 45 fd sqrt(:d*:d*2) rt 135 fd :d lt 90] end
strom 50 3
STROM 2
to binstrom :d :n if :n=0 [ fd :d bk :d ] if :n>0 [ fd :d lt 60 binstrom :d*2/3 :n-1 rt 120 binstrom :d*2/3 :n-1 lt 60 bk :d ] end
binstrom 150 4
hviezda
to 5hviezda :d repeat 5 [ fd :d lt 144 ] end
5hviezda 100