Tymless Tutorial: Reference



   
  < turn commands

Other Commands

 
assignment >
 

Drawing

Control

Data

Reference

 

public

Use this command to declare one or more variables with public scope. You can also assign them values at the same time, e.g.

public ShapeCount=0, CurrentColour

Public variables can be read and changed by all turtles. If changed by a child-turtle, they retain their value when control passes back to the parent.

Only root variable names can be declared public, e.g.

public name_1      // illegal. subscripts are not at root level
public tri.colour  // illegal. properties are not at root level

However public variables can contain structures, whose parts will all be public.


tell

This command puts a message on the message-board, and indicates which row and column in the program it came from. It is useful for debugging programs:

a = ?? factor = ??*10
tell "start = "+a+", factor = "+factor
do 20
   a = a * factor mod 1
   tell a
end

This program prints a list of pseudo-random numbers.


print

This command is like tell, but does not add the row and column information.

print "hello world"


note

Use this command to add text to your images. The text is printed at the position of the turtle, but the turtle does not move or turn. Use the system variables $fontname, $fontsize and $fontcolour to control the way the text looks.


clearshapes

deletes all the shapes in $shapes


paint

Draws all the shapes onto the image

clearpaint

Clears the image then draws all the shapes onto the image


saveimage filename

Draws all the shapes onto the image, then saves the image to a bitmap file

clearsave filename

Clears the image, draws all the shapes onto the image, then saves the image to a bitmap file

savemessages filename

Prints all messages to the messageboard then saves them to a text file.

Note, all the 'save' commands will overwrite the file it it already exists.

   
  < turn commands
 
assignment >