Program 3
Program 3
Show()
GraphicsWindow.BackgroundColor = "black"
TextWindow.WriteLine("Hi, I'm Mr. Smort.")
TextWindow.WriteLine("I can help you draw a square or rectangle. Use me to
navigate.")
TextWindow.Write("What is your name?")
name = TextWindow.Read()
TextWindow.WriteLine("Hi, " + name)
TextWindow.Write("Choose a number from 1 to 25 to define the thickness of your
pen.")
number = TextWindow.ReadNumber()
GraphicsWindow.PenWidth = number
TextWindow.Write("Your colour is currently multicolour.")
TextWindow.Write("To change it Choose 'yes'/'no'")
answer = TextWindow.Read()
GraphicsWindow.KeyDown = SME
Sub SME
If answer = "yes" then
GraphicsWindow.PenColor = colour
Else
If GraphicsWindow.LastKey = "ArrowUp" Then
GraphicsWindow.PenColor = "red"
ElseIf GraphicsWindow.LastKey = "ArrowDown" Then
GraphicsWindow.PenColor = "blue"
ElseIf GraphicsWindow.LastKey = "ArrowLeft" Then
GraphicsWindow.PenColor = "green"
ElseIf GraphicsWindow.LastKey = "ArrowRight" Then
GraphicsWindow.PenColor = "cyan"
EndIf
EndIf