Microsoft Small Basic

Program Listing: VVS965
'Show the tortoise --#1
Tortoise.Show()
'Make the tortoise move as fast as possible --#9
Tortoise.SetSpeed(10)
'Make the background silver --#10
ProgramWindow.SetBackgroundColor(Colors.Silver)
'Make the line the tortoise draws 3 pixels wide --#24
Tortoise.SetPenWidth(3)
'CreateColorPalette (recipe below) --#12
CreateColorPalette()
'Do the following 15 times --#23
For j = 1 To 15
' DrawOctogon (recipe below) --#14
DrawOctogon()
' Turn the tortoise 1/15th of 360 degrees to the right --#22
Tortoise.Turn(360/15)
'Repeat --#23
EndFor


'------------- Recipe for CreateColorPalette --#11
Sub CreateColorPalette
' Color 1 is red --#4.1
color1 = Colors.Red
' Color 2 is dark orange --#15.1
color2 = Colors.DarkOrange
' Color 3 is gold --#16.1
color3 =Colors.Gold
' Color 4 is yellow --#17.1
color4 = Colors.Yellow
' Add color 1 to the color wheel --#4
ColorWheel.AddColor(color1)
' Add color 2 to the color wheel --#15
ColorWheel.AddColor(color2)
' Add color 3 to the color wheel --#16
ColorWheel.AddColor(color3)
' Add color 4 to the color wheel --#17
ColorWheel.AddColor(color4)
' Add color 4 to the color wheel --#18
ColorWheel.AddColor(color4)
' Add color 3 to the color wheel --#19
ColorWheel.AddColor(color3)
' Add color 2 to the color wheel --#20
ColorWheel.AddColor(color2)
' Add color 1 to the color wheel --#21
ColorWheel.AddColor(color1)
'------------- End of CreateColorPalette recipe --#11
EndSub

'------------- Recipe for DrawOctogon --#13
Sub DrawOctogon
' Do the following 8 times --#6
For i = 1 To 8
' Change the color of the line the tortoise draws to the next color on the color wheel --#3
Tortoise.SetPenColor(ColorWheel.GetNextColor())
' Move the tortoise 50 pixels --#2
Tortoise.Move(50)
' Turn the tortoise 1/8th of 360 degrees to the right --#5
Tortoise.Turn(360/8)
' Repeat --#8
EndFor
'------------- End of DrawOctogon recipe --#13
EndSub