Skip to content

Latest commit

 

History

History
53 lines (44 loc) · 820 Bytes

flowerVines.toby

File metadata and controls

53 lines (44 loc) · 820 Bytes
 
Apr 18, 2001
Apr 18, 2001
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
number r = 0.0
number g = 0.0
number b = 0.0
function main() returns nothing
hideTurtle()
disableFence()
rightDragon(20, 3)
endfunction
function leftDragon(number iteration, number dist) returns nothing
r = r + 0.001
if (r > 1.0)
r = 0.0
endif
setPenColorRGB(r, g, b)
if (iteration == 0)
g = g + 0.01
if (g > 1.0)
g = 0.0
endif
goForward(dist)
else
leftDragon(iteration - 1, dist)
turnLeft(90)
rightDragon(iteration - 1, dist)
endif
endfunction
function rightDragon(number iteration, number dist) returns nothing
b = b + 0.001
if (b > 1.0)
b = 0.0
endif
setPenColorRGB(r, g, b)
if (iteration == 0)
g = g + 0.01
if (g > 1.0)
g = 0.0
endif
goForward(dist)
else
leftDragon(iteration - 1, dist)
turnRight(90)
rightDragon(iteration - 1, dist)
endif
endfunction