Parameter/Argument notes:

Enclosed in curly brackets ({}): Optional/Not Required.

Enclosed in square brackets ([]): Item from a specified options list.

Core Syntax

Variable Management and Modification commands

Variable declaration (reg):

Definition:To create or modify a variable

Syntax: reg data-type var-name value

Example: reg int a 5*5

Data-Types: int //integer literals float //decimal integer literals str //string literals bool //true/false literal lst //unsupported data type, currently in development.

Variable naming convention: abcd //Allowed 3bcd //Wont return an error but the variable wont be accessable. 34 //Wont return an error but the variable wont be accessable. ab4d //Allowed ab_3 //Allowed _ab //Allowed _ //Allowed !@#$%^ //Wont return an error but the variable wont be accessable.

Variable calling ($var):

Definition:for maths expression and variable calling in prt command

Syntax: $var_name

Example: reg int a 5*5 reg int area $pi*$r**2

Variable deletion (del):

Definition:To delete a variable.

Syntax: del var "var_name"

Example: reg int a 5 del var a

Numeral variable increment (inc):

Definition: increments a variable of type int or float by 1.

Syntax: inc var_name

Example: inc x

Numeral variable decrement (dec):

Definition: decrements a variable of type int or float by 1.

Syntax: dec var_name

Example: dec x

File Management Commands

File import/loading (load):

Definition: Loads the content of a provided .x3 file onto the current x3 execution session.

Syntax: load file_path

Example: load E:/abcd.x3 load "C:/Users/Admin/ExtraPackages/2DGraphics.x3"

Create File (w_file):

Definition: Creates a new file and writes content to it.

Syntax: w_file filename "content"

Example: w_file notes.txt "This is the first line."

Read File (r_file):

Definition: Reads a file’s content and stores it in a variable.

Syntax: r_file filename var_name

Example: r_file notes.txt file_content

Append to File (a_file):

Definition: Appends text to an existing file.

Syntax: a_file filename "content"

Example: a_file notes.txt "Additional text"

Delete File (del_file):

Definition: Deletes a specified file.

Syntax: del_file filename

Example: del_file old_data.txt

Create Directory (create_dir):

Definition: Creates a new directory.

Syntax: create_dir directory_name

Example: create_dir logs

Delete Directory (delete_dir):

Definition: Deletes an empty directory.

Syntax: delete_dir directory_name

Example: delete_dir logs

Search File (search_file):

Definition: Searches for a keyword in a file.

Syntax: search_file filename keyword

Example: search_file notes.txt "important"

Control Flow commands:

Operator Syntax (<,>,==,!=,>=,<=):

Definition: Syntax for operators.

Syntax: Check the operators page.

Skip to line (goto):

Definition: sets the interpreter current line to the specified line.

Syntax: goto line(int) //Range=1->EoF

Example: goto 1

if statement (if):

Definition:conditional statement used to execute a block of code based on whether a condition is true or false

Syntax: if condition

Example if $x == 5 or $y == 2

else statement (else):

Definition:used in conditional statements with "if" statements, to specify an alternative path of execution when the condition in the "if" statement is false.

Syntax:else

Example: if $x == 5 prt "Variable x is 5" else prt "Variable x is not 5" end

end statement (end):

Definition:used in conditional flow statements to end a sequential block.

Syntax: end

Example: if $x!=5 prt "Variable x is not 5" else prt "Variable x is 5" end

while statement (while):

Definition:a control structure that repeatedly executes a block of code as long as a specified condition remains true.

Syntax: while conditon

Example: while $x <= 5 prt $x inc x end

bruteforce statement (brute):

Definition:A bruteforce control flow command, that will execute its block until it encounters an end, regardless of errors.

Syntax: brute

Example: brute prt ##fetch:(https://nonexistentwebsite.xyz.co) end

Function Management and Modification Commands.

Function definiton (def):

Definition:used to define or declare a function.

Syntax: def function-name args

Example: def Hello var prt "hello $var" fncend

Function definition end statement (fncend):

Definition:used to mark the end of a function definition.

Syntax: fncend

Example: def t1 prt "t1" fncend

Function calling (call):(The call statement has been deprecated, use the new function calling method)

Definition:to call(execute) a function.

Syntax: call function-name args

Warning:Can't work with functions with return statements, kindly use the newer function calling method for handling functions with returns.

Example: def Hello var prt "hello $var" fncend call hello "world"

Function calling 2.0 (##function:(args)):

Definition:function calling inside other commands

Syntax: ##function-name:(args)

Warning:if a variable is supplied with the same name as the parameter of the called function, the interpreter would return an error and stop. Example: def func abcd xyz prt "$abcd & $xyz" fncend ##func:($abcd $pi) would cause the interpreter to terminate.

Example: def Hello var return "hello $var" fncend prt ##Hello:("World")

Function return (return):

Definition: returns the value for the function which contains it to inline function calls.

Syntax: return value

Example: def func a b c reg int x $a*$b*$c return $x fncend prt ##func:(1 2 3) //this will output 6

Function deletion (del):

Definition: Deletes a function.

Syntax: del func func_name

Example: def temp fncend del func temp

Logging Commands:

Log Message (log):

Definition: Logs a message for debugging or tracking.

Syntax: log message

Example: log "Script executed successfully"

Print Command (prt);

Definition: Prints text or variables with formatting options.

Syntax: prt value {options}

Example: prt "Hello, World!" align=center

Utility Commands:

Wait (wait):

Definition: Pauses execution for a specified time.

Syntax:

wait seconds

Flush (flush):

Definition: Clears all stored variables and functions.

Syntax: flush

Inbuilt debugger (dev.debug):

Syntax: dev.debug [option]

Options: - dev controlflow → Enables control flow debugging - dev print → Enables print debugging - dev math → Enables math debugging - dev file → Enables file handling debugging - dev colorama → Enables Colorama debugging - dev requests → Enables requests debugging - dev condition → Enables condition evaluation debugging - dev variable → Enables variable handling debugging - dev command → Enables Command handling debugging - dev None → Disables all debugging options - dev All → Enables all debugging options

Example: dev.debug math

Internet Utility Commands

Url data fetcher (fetch):

Definition: Gets(fetches) the raw textual data from a URL.

Syntax: fetch protocol://domain.TLD

Example: fetch https://example.org/textfile.txt

Inline data fetcher (##fetch:())

Definition: returns the fetched URL content.

Syntax: ##fetch:(URL) or ##fetch:[option]:(URL)

Options: json status headers content html xml

Example: prt ##fetch:(https://example.org/textfile.txt)

if ##fetch:status:($URL) != 200 prt "$URL is not available at the moment" end

System Commands:

Exit (exit):

Definition: Immediately terminates the script.

Syntax: exit {message}

Clear Screen (cls):

Definition: Clears the terminal screen.

Syntax: cls {legacy}

Warning:Use the optional legacy keyword for terminals that dont work with cls.

Set Client Rules (setclientrule):

Definition: Sets specific pre-defined interpreter/client rules to true or false.

Syntax: setclientrule [option]

Options: repl //read->evaluate->print->loop semo //script execution mode only disableprt //disables all prt statements reset //resets all rules back to false

Example: setclientrule

Input Handling:

Input Command (inp):

Definition: Prompts the user for input and stores it, if no input is given, store a default data in var

Syntax: inp variable_name {"prompt message"} {default}

Arithmetic Commands:(Deprecated, use reg int var math-expression OR fastmath var = expression

Faster math statement(fastmath):

Definition:for faster calculation speed.

Syntax: fastmath var = expression

Warning: Use the variable name with no leading "$" character while using fastmath.

Warning 2: there should be no trailing or leading spaces while using fastmath, for example: fastmath abcd = $a**2 will return an error, instead use fastmath in this way: fastmath abcd=$a**2

Example: fastmath abcd =(5*5%6**9*1.00007632**2)/1000

Addition (add):

Definition: Adds two numbers and stores the result.

Syntax: add var_name num1 num2

Subtraction (sub):

Definition: Subtracts two numbers and stores the result.

Syntax: sub var_name num1 num2

Multiplication (mul):

Definition: Multiplies two numbers and stores the result.

Syntax: mul var_name num1 num2

Division (div):

Definition: Divides two numbers and stores the result.

Syntax: div var_name num1 num2

Modulus (mod):

Definition: Performs modulation on two numbers and stores the result.

Syntax: mod var_name num1 num2

Square Root (sqrt):

Definition: Calculates the square root of a number.

Syntax: sqrt var_name

Misc

Nibbits

Definition: extra inline functions, that can be used in statements.(arguments must be enclosed in parentheses)

Syntax: ##[option]:(args) ##[option] ##[option]:type ##[option]:type:(args)

Options: interpreter:vars interpreter:funcs interpreter:memory interpreter:platform interpreter:eval random randint timeseconds timestamp date time datetime datetime:iso datetime:utc REPL uuid uuid:hex user hostname platform osversion cwd randbool msec env upper lower reverse length capitalize pingreport ping rgb readfile

Usage: check the Nibbits page.