Interface Turtle

Turtle interface.

Defines the interface that any turtle must implement. Note that the standard directions/rotations use Logo semantics: initial heading of zero is 'up', and positive angles rotate the turtle clockwise.

interface Turtle {
    color(color): void;
    forward(units): void;
    getSVG(): string;
    turn(degrees): void;
}

Implemented by

Methods

  • Change the turtle's current pen color.

    Parameters

    Returns void

  • Move the turtle forward a number of steps.

    Parameters

    • units: number

      number of steps to move in the current direction; must be positive

    Returns void

  • Get the image created by this turtle.

    Returns string

    string containing image in SVG format

  • Change the turtle's heading by a number of degrees clockwise.

    Parameters

    • degrees: number

      amount of change in angle, in degrees, with positive being clockwise

    Returns void

Generated using TypeDoc