Difference between revisions of "Vianoce s robotnackou"
From RoboWiki
m (New page: === 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 :...) |
(→Obrazky robene imaginom) |
||
Line 1: | Line 1: | ||
=== Obrazky robene imaginom === | === Obrazky robene imaginom === | ||
− | VLOCKA | + | = VLOCKA = |
to vlocka :r :d :u | to vlocka :r :d :u | ||
Line 33: | Line 33: | ||
Odporúčam zadať: '''vlocka 8 150 2'''<br /> | Odporúčam zadať: '''vlocka 8 150 2'''<br /> | ||
− | STROM | + | = STROM = |
to strom :d :n | to strom :d :n | ||
Line 41: | Line 41: | ||
repeat :n[lt 45 fd sqrt(:d*:d*2) rt 135 fd :d lt 90] | repeat :n[lt 45 fd sqrt(:d*:d*2) rt 135 fd :d lt 90] | ||
end | end | ||
− | strom 50 3 | + | |
+ | '''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''' |
Latest revision as of 22:24, 16 December 2008
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