Microsoft Small Basic

Program Listing: TPK457
' Center of the graphics window.
w = GraphicsWindow.Width / 2
h = GraphicsWindow.Height / 2

' Move the turtle to the center of the graphics window.
Turtle.Show()
Turtle.X = w
Turtle.Y = h

' Make the turtle draw fast (but not too fast!).
Turtle.Speed = 7

' Draw the "H" in "Hi!"
Turtle.Turn(180) ' Turns the turtle at the specified speed.
Turtle.Move(40)
Turtle.MoveTo(w, h + 20) ' Same as Turtle.X with Turtle.Y, but moves at specified speed instead of instantly.
Turtle.TurnRight()
Turtle.Move(20)
Turtle.MoveTo(w + 20, h)
Turtle.Angle = 180 ' Same as Turtle.Turn(180), but Turtle.Angle turns instantly.
Turtle.Move(40)

' Draw the "i" in "Hi!"
Turtle.X = w + 30 ' Same as first part of Turtle.MoveTo, but moves instantly and doesn't draw while moving.
Turtle.Y = h ' Same as second part of Turtle.MoveTo, but moves instantly and doesn't draw while moving.
Turtle.PenUp() ' Now, when the turtle moves, it won't also draw.
Turtle.Move(10)
Turtle.PenDown() ' Now the turtle draws as it moves.
Turtle.Move(5)
Turtle.PenUp() ' Stop drawing.
Turtle.Move(5)
Turtle.PenDown() ' Start drawing again.
Turtle.Move(20)

' Draw the "!" in "Hi!"
Turtle.X = w + 40
Turtle.Y = h
Turtle.Move(30)
Turtle.PenUp()
Turtle.Move(5)
Turtle.PenDown()
Turtle.Move(5)

Turtle.Hide()