Skip to content

Features & Functions

Sten edited this page Nov 7, 2023 · 2 revisions

Built-in Functions

print

You can print strings and other value types to the output console.

print("test")               // test
print(69420)                // 69420

You can also provide multiple parameters so they become concatenated with a space in between.

print("number:", 1)         // number: 1
print("list:", [1, 2, 3])   // list, [1, 2, 3]

input

You can obtain input from the user through the console by using the input() function. This will always be a string.

let user_input = input()

exit

You can safely exit a program by using the exit() function

exit()

You can provide an exit code by giving it as a parameter

exit(69)

range

Get a list of numbers based on an input.

let x = range(10)       // 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
let y = range(4, 10)    // 4, 5, 6, 7, 8, 9
let z = range(4, 10, 2) // 4, 6, 8

len

Get the length of the object based on what it is.

let str = len("test")       // 4
let list = len([1, 2, 3])   // 3

int

By using this function you can convert a string or a double float to an integer. If you give it a floating point string it will be rounded down.

let rounded = int("69.420") // 69
let integer = int("420")    // 420
let floor   = int(69.420)   // 69

type

Get the type of the object as a string.

let s = type("string")  // String
let n = type(69)        // Number
let l = type([1, 2, 3]) // List
let b = type(true)      // Boolean

double

By using the double() function you can convert a string with a decimal point to a standard number.

let num = double("69.420") // 69.42

time

time is an object that contains function that utilities for interacting with time

sleep

time.sleep() will pause the script for x amount of milliseconds.

time.sleep(1000)    // sleeps for 1 second
time.sleep(420)     // sleepds for 420 milliseconds

epoch

time.epoch() will get the current time in epoch format

let t = time.epoch()
Clone this wiki locally