Microsoft Small Basic

Program Listing: WJJ750
'Make the tortoise go as fast as possible --#8
Tortoise.SetSpeed(10)
'Change the width of the line the tortoise draws to 1 pixel --#14
Tortoise.SetPenWidth(1)
'Change the color of the line the tortoise draws to silver --#15
Tortoise.SetPenColor(Colors.Silver)
'The current length of a line is 10 pixels --#1.1
length = 10
'The current zoom is 1 --#9.1
zoom = 1
'Do the following 10 times --#12
For k = 1 To 10
' WeaveOneLayer (recipe below) --#11
WeaveOneLayer()
' Change the zoom so it is multiplied by 1.3 --#13
zoom = zoom * 1.3
'Repeat --#12
endfor

'------------- Recipe for WeaveOneLayer --#10
Sub WeaveOneLayer
'Do the following 6 times --#7
For j = 1 To 6
' DrawTriangle (recipe below) --#5
DrawTriangle()
' Turn the tortoise 1/6th of 360 degrees to the right --#6
Tortoise.Turn(360/6)
' Increase the current length of the line by the current zoom --#9
length = length+zoom
'Repeat --#7
EndFor
'------------- End of WeaveOneLayer recipe --#10
EndSub

'------------- Recipe for DrawTriangle --#4
Sub DrawTriangle
'Do the following 3 times --#3
For i = 1 To 3
' Move the tortoise the current length of a line --#1
Tortoise.Move(length)
' Turn the tortoise 1/3rd of 360 degrees --#2
Tortoise.Turn(360/3)
'Repeat --#3
EndFor
'------------- End of DrawTriangle recipe --#4
EndSub