• Commands
  • Basics
  • Structures
  • Operators
  • User Input
  • Constants

Native Turtle Commands

The languages understood by the Turtle System come with several built in procedures and functions, including those that implement the Turtle Graphics drawing metaphor. A full list of commands is shown in the table below. For convenience, they have been grouped into 10 categories, and divided into three difficulty levels. Only simple commands are shown by default; use the tickboxes below to show intermediate and advanced commands as well.

CommandDescription

Colours

The Turtle System has 50 predefined colour constants, shown in the table below. Every command that takes a colour argument (e.g. the colour command, which sets the Turtle's current drawing colour) can be given an RGB value, or one of the predefined colour names below. The compiler will translate this name into the corresponding RGB value. Alternatively, you can also use the corresponding number between 1 and 50, which the Turtle Machine will translate into the RGB value when your program runs.

No.Name
Value
No.Name
Value
No.Name
Value
No.Name
Value
No.Name
Value

Fonts

The Turtle System has 16 fonts for drawing text on the canvas, shown in the table below. The print command takes a font parameter, which must be an integer between 0 and 255. The integers in the range 0-15 correspond to plain versions of the 16 fonts. To render the text in italics, add 16 to this base; to render it in bold, add 32; to render it as underlined, add 64; and to render it with a strikethrough line, add 128. This additions are cumulative; thus to render the text in italic and bold, add 16+32.

N.B. Underline and strikethrough are only available on the downloadable system, not the online version. This is because the HTML5 canvas specifications do not support these features.

Font Family NamePlainItalicBoldItalic+BoldUnderlineStrikethrough

Cursors

The native cursor command sets which cursor to display when the mouse is over the canvas. Setting it to 0 makes the mouse invisible. Values in the range 1-15 set it to the cursor shown in the table below (move your mouse over each box to preview the cursor). Any other value will reset to the default cursor. Note that the actual cursor displayed depends on your operating system, and may vary from computer to computer.

No.NameNo.NameNo.NameNo.Name