Sub Do
x = Turtle.X
y = Turtle.Y
If Text.StartsWith(cmd, "Right") Then
GetOperand()
If operand = "" Then
operand = 1
EndIf
Turtle.MoveTo(x + operand * size, y)
ElseIf Text.StartsWith(cmd, "Left") Then
GetOperand()
If operand = "" Then
operand = 1
EndIf
Turtle.MoveTo(x - operand * size, y)
ElseIf Text.StartsWith(cmd, "Up") Then
GetOperand()
If operand = "" Then
operand = 1
EndIf
Turtle.MoveTo(x, y - operand * size)
ElseIf Text.StartsWith(cmd, "Down") Then
GetOperand()
If operand = "" Then
operand = 1
EndIf
Turtle.MoveTo(x, y + operand * size)
ElseIf Text.StartsWith(cmd, "Fill") Then
GetOperand()
If operand = "" Then
operand = "Black"
EndIf
FillBrick()
EndIf
EndSub
Sub DrawGrid
GraphicsWindow.PenWidth = 1
GraphicsWindow.PenColor = "Gray"
For x = 0 To gw Step size
GraphicsWindow.DrawLine(x, 0, x, gh)
EndFor
For y = 0 To gh Step size
GraphicsWindow.DrawLine(0, y, gw, y)
EndFor
EndSub