Tymless Tutorial: Reference



   
  < assignment

System Functions

 
operators >
 

Drawing

Control

Data

Reference

 

A Tymless function takes a following argument and returns a result. The argument need only be placed in brackets if it is a list. E.g.

sin 1.2
rgb(1,0,0)
sqrt cos 0.8

Each function expects its argument to be of a certain data-type. If the wrong data-type is supplied the program stops running and an error message is printed on the messageboard.

This list of system functions does not include turtle-commands (see forward, turning and other commands).

Argument Types:

  n number
  n* number, location, shape or the entire shape list $shapes.
  v user-defined variable
  loc location
  t text
  - no argument required

Function Argument Returns
- n* the negative
/ n* the inverse (i.e. 1/n)
? - a 0 or 1 at random
?: n a random integer between 1 and n inclusive
?? - a random number between 0 and 1
& v an alias of (or reference to) the variable
;? loc the distance from here to the location
!? loc the direction from here to the location
sin n* the sine
cos n* the cosine
tan n* the tangent
asin n* the arcsine
acos n* the arccosine
atan n* the arctangent
sqrt n* the square root
sign n -1 if negative, 0 if zero, 1 if positive
abs n the absolute value (ignoring sign)
not n 0 if non-zero, otherwise 1
floor n the next lowest integer
ceiling n the next highest integer
round n the nearest integer
rgb (n1, n2, n3) the colour with r = n1, g = n2 and b = n3
hsv (n1, n2, n3) the colour with h= n1, s= n2 and v= n3
affine

(n, n, n, n, n, n) or
(loc, loc, loc)

an affine transformation object
chartoasc t the numeric ASCII value of the first character
asctochar n the character corresponding to the ASCII value
strlower t a lowercase version
strupper t an uppercase version
strtrim t removes leading and trailing spaces
   
  < assignment
 
operators >