Built-in Functions

Built-in tools for everyday use.

time()

The built-in time function is used to get the current system time.

Signature:

number time()

clock()

The built-in clock function returns the amount of clock ticks since the interpreter was launched.

Signature:

number clock()

exit(code)

The built-in exit function exits the program with the given exit code.

Signature:

void exit(number)

input(prompt)

The built-in input function prompts a user for an input and returns the user's input.

Signature:

string input(string)

print(value...)

The built-in print function prints one or more values.

Signature:

void print(any...)

println(value...)

The built-in println function prints one or more values, appending a newline afterwards.

Signature:

void println(any...)

bool(value)

The built-in bool function converts an arbitrary value to a boolean data type.

Signature:

boolean bool(any)

num(string)

The built-in num function converts a string to a number.

Signature:

number num(string)

str(value)

The built-in str function converts an arbitrary value to a string.

Signature:

string str(any)

ceil(num)

The built-in ceil function raises a decimal to the closest upper integer.

Signature:

number ceil(number)

floor(num)

The built-in floor function lowers a decimal to the closest lower integer.

Signature:

number floor(number)

pow(num, power)

The built-in pow function raises a number to the power of another number.

Signature:

number pow(number, number)

random()

The builtin random function generates a random number between 0 and 1.

Signature:

number random()