Sub variation4Width
text[4] = "Variation - Width (thick)"
width = 5
square()
EndSub
Sub variation3Colors
text[3] = "Variation - Colors"
random = "true"
square()
EndSub
Sub variation1Sides
text[1] = "Variation - # of Sides (3)"
sides = 3
square()
EndSub
Sub variation2Sides
text[2] = "Variation - # of Sides (8)"
sides = 8
square()
EndSub
Sub simpleSquare
text[0] = "Simple Square"
sides = 4
length = 50
lengthBase = 1
widthBase = 1
width = 2
random = "false"
widthVariable = "false"
lengthVariable = "false"
circles = 1
square()
endsub
Sub square
GraphicsWindow.Clear()
Turtle.Show()
Turtle.X = originalX
Turtle.Y = originalY
drawText()
For i = 1 To sides
setColor()
If (widthVariable = "true") Then
widthBase = i
EndIf
GraphicsWindow.PenWidth = width * widthBase
If (lengthVariable = "true") Then
lengthBase = i
EndIf
Turtle.Move(length* lengthBase)
Turtle.Turn(360*circles/sides)
EndFor
Program.Delay(2000)
EndSub
Sub drawText
For t = 0 To times
GraphicsWindow.DrawText( 30, 30 + 20 * t,text[t])
endfor
times = times + 1
endsub
sub setColor
If (random = "true") Then
GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor()
Else
GraphicsWindow.PenColor = "blue"
EndIf
EndSub