Microsoft Small Basic

Program Listing: VQJ995
'Make the tortoise move as fast as possible --#4
Tortoise.SetSpeed(10)
'CreateColorPalette (recipe below) --#6
CreateColorPalette()
'Do the following 30 times --#10
For j = 1 To 30
' Change the color of the line the tortoise draws to a random color from the color wheel --#5
Tortoise.SetPenColor(ColorWheel.GetRandomColor())
' DrawOctagonWithOverlap (recipe below) --#8
DrawOctagonWithOverlap()
' Turn the tortoise 1/30th of 360 degrees to the right --#9
Tortoise.Turn(360/30)
' Turn the tortoise 5 more degrees to the right --#11
Tortoise.Turn(5)
'Repeat --#10
EndFor

'------------- Recipe for CreateColorPalette --#6
Sub CreateColorPalette
' Add hot pink to the color wheel --#6
ColorWheel.AddColor(Colors.HotPink)
' Add red to the color wheel --#12
ColorWheel.AddColor(Colors.Red)
' Add fuchsia to the color wheel --#13
ColorWheel.AddColor(Colors.Fuchsia)
' Add orange red to the color wheel --#14
ColorWheel.AddColor(Colors.OrangeRed)
' Add deep pink to the color wheel --#15
ColorWheel.AddColor(Colors.DeepPink)
' Add medium violet red to the color wheel --#16
ColorWheel.AddColor(Colors.MediumVioletRed)
' Add crimson to the color wheel --#17
ColorWheel.AddColor(Colors.Crimson)
' Add tomato to the color wheel --#18
ColorWheel.AddColor(Colors.Tomato)
'------------- End of CreateColorPalette recipe --#6
EndSub

'------------- Recipe for DrawOctagonWithOverlap --#7
Sub DrawOctagonWithOverlap
' Do the following 8 + 1 times --#3
For i = 1 To 9
' Move the tortoise 110 pixels --#1
Tortoise.Move(110)
' Turn the tortoise 1/8th of 360 degrees to the right --#2
Tortoise.Turn(360/8)
' Repeat --#3
EndFor
'------------- End of DrawOctagonWithOverlap recipe --#7
EndSub