Turtle

Turtle Graphics
This topic addresses the following graphic methods:
 * Turn
 * Go
 * North

Turtle graphics are drawn with a pen that travels around the graphic area. If the pen is Down the drawing is visible. If the pen is Up, the drawing pen moves, but the drawing is not visible. Graphics are drawn in the current Size and Color.

When a graphic object is created, the drawing pen is at point 0,0 and it is facing East (to the right.) The size is one pixel wide and the color is black. The pen is Down by default.

To change the direction of the drawing pen, use the **Turn** method. The syntax is as follows:
 * Turn**


 * 1) handle TURN(a) - Turn the turtle a degrees to the right. a can be negative to turn to the left

To draw a straight line from the current pen position to a new possition, use **Go** Here is the syntax:
 * Go**


 * 1) handle GO(d) - Make the turtle go distance d

To set the direction of the drawing pen to North, or pointing to the top of the page, use **North**. The syntax is:
 * North**


 * 1) handle NORTH - Tell the turtle to point to the top of the graphic object.

Here is a simple demo that illustrates these turtle graphics methods.

code format="vbnet" 'create a graphic object graphic #g, 800,600

'by default, the drawing pen 'is at 0,0 and facing east (right)

'turn clockwise 75 degrees
 * 1) g turn(75)

'travel 100 pixels in the current direction
 * 1) g go(100)

'turn counterclockwise 90 degrees
 * 1) g turn(-90)

'travel 80 pixels in current direction
 * 1) g go(80)

'set pen to face north
 * 1) g north

'travel 20 pixels in the current direction
 * 1) g go(20)

'display graphic object on web page render #g code