Skip to content

Built‐in Functions

Bruce Li edited this page Jan 21, 2024 · 3 revisions

Add:

Syntax: add(num1, num2)

Returns the sum of two numbers.

Subtract:

Syntax: subtract(num1, num2)

Returns the result of subtracting num2 from num1.

Multiply:

Syntax: multiply(num1, num2)

Returns the product of two numbers.

Divide:

Syntax: divide(num1, num2)

Returns the result of dividing num1 by num2.

Artboard:

Syntax: artboard(color)

Initializes a Turtle Graphics artboard with the specified color.

ArtColor:

Syntax: artColor(color)

Sets the color of the Turtle Graphics pen.

ArtLeft, ArtRight, ArtForward, ArtBackward:

Syntax: artLeft(amount), artRight(amount), artForward(amount), artBackward(amount)

Moves the Turtle Graphics pen left, right, forward, or backward by the specified amount.

ArtClose:

Syntax: artClose()

Closes the Turtle Graphics window.

ArtSpeed:

Syntax: artSpeed(speed)

Sets the speed of the Turtle Graphics pen.

ArtKey:

Syntax: artKey(function, key)

Binds a key to an action.

ArtColor:

Syntax: artColor(color)

Sets a turtle color after the turtle has been created.

ArtStatic:

Syntax: artStatic(feature)

Uses either dot or stamp

Clone this wiki locally