Microsoft Small Basic

Program Listing: VRD858
'Published ID#
'Make the tortoise move as fast as possible --#3
Tortoise.SetSpeed(10)
'CreateColorPalette (recipe below) --#9
CreateColorPalette()
'DrawPentagon (recipe below) --#12
DrawPentagon()

'------------- Recipe for CreateColorPalette --#8
Sub CreateColorPalette
' Add steel blue to the color wheel --#7
ColorWheel.AddColor(Colors.SteelBlue)
' Add dark orchid to the color wheel --#13
ColorWheel.AddColor(Colors.DarkOrchid)
' Add dark slate blue to the color wheel --#14
ColorWheel.AddColor(Colors.DarkSlateBlue)
' Add teal to the color wheel --#15
ColorWheel.AddColor(Colors.Teal)
' Add indigo to the color wheel --#16
ColorWheel.AddColor(Colors.Indigo)
'------------- End of CreateColorPalette recipe --#8
EndSub

'------------- Recipe for AdjustPen --#9
Sub AdjustPen
' Change the color of the line the tortoise draws to the next color on the color wheel --#6
Tortoise.SetPenColor(ColorWheel.GetNextColor())
' Increase the tortoise's pen width by 1
Tortoise.SetPenWidth(Tortoise.GetPenWidth()+1)
' If the tortoise's pen width is greater than 4, then
If (Tortoise.GetPenWidth() > 4) then
' Reset it to 1
Tortoise.SetPenWidth(1)
EndIf
'------------- End of AdjustPen recipe --#9
EndSub

'------------- Recipe for DrawPentagon --#11
Sub DrawPentagon
'Do the following 200 times --#2
For i = 1 To 200
' AdjustPen (recipe above) --#10
AdjustPen()
' Move the tortoise the length of a side --#4
Tortoise.Move(i)
' Turn the tortoise 1/5th of 360 degrees --#1
Tortoise.Turn(360/5)
' Turn the tortoise 1 more degree --#5
Tortoise.Turn(1)
'Repeat --#2
EndFor
'------------- End of DrawPentagon recipe --#11
EndSub