Program 2
Program 2
")
TextWindow.WriteLine("You are going to make a square.")
TextWindow.Write("What is your name?")
name = TextWindow.Read()
TextWindow.WriteLine("Hi, " + name)
TextWindow.Write("Choose a number from 1 to 50.")
number = TextWindow.ReadNumber()
GraphicsWindow.PenWidth = number
TextWindow.Write("Black, Red, Green, Blue, or Multicolour?")
color = TextWindow.Read()
If color = "black" Then
GraphicsWindow.PenColor = "black"
ElseIf color = "red" Then
GraphicsWindow.PenColor = "red"
ElseIf color = "green" Then
GraphicsWindow.PenColor = "green"
ElseIf color = "blue" Then
GraphicsWindow.PenColor = "blue"
ElseIf color = "multicolour" Then
EndIf
Turtle.Show()
SME = GraphicsWindow.KeyDown
Sub SME
If GraphicsWindow.LastKey = "ArrowUp" Then
GraphicsWindow.PenColor = "red"
Turtle.Move(15)
EndIf
If GraphicsWindow.LastKey = "ArrowDown" Then
GraphicsWindow.PenColor = "blue"
Turtle.Move(-15)
EndIf
If GraphicsWindow.LastKey = "ArrowLeft" Then
GraphicsWindow.PenColor = "black"
Turtle.TurnLeft()
Turtle.Move(15)
EndIf
If GraphicsWindow.LastKey = "ArrowRight" Then
GraphicsWindow.PenColor = "green"
Turtle.TurnRight()
Turtle.Move(15)
EndIf
EndSub