Built-in Functions
Input/Output
Section titled “Input/Output”| Function | Description | Example |
|---|---|---|
print(...) | Print values to console | print("Hello", x, y); |
input(prompt) | Read string from user | str name = input("Name: "); |
inputInt(prompt) | Read integer | int age = inputInt("Age: "); |
inputFloat(prompt) | Read float | float val = inputFloat("Value: "); |
Type Conversion
Section titled “Type Conversion”| Function | Description | Example |
|---|---|---|
toInt(value) | Convert to integer | int x = toInt("123"); |
toFloat(value) | Convert to float | float y = toFloat("3.14"); |
toString(value) | Convert to string | str s = toString(42); |
toBool(value) | Convert to boolean | bool b = toBool(1); |
Array Operations
Section titled “Array Operations”| Function | Description | Example |
|---|---|---|
length(arr) | Get array/object length | int len = length(arr); |
push(arr, value) | Add element | push(arr, 10); |
pop(arr) | Remove and return last | int x = pop(arr); |
range(n) | Create integer range | for (i in range(10)) {...} |