X³ Documentation Logo

Details:

Version: 1.4

Last Updated On: 20/09/24 (dd/mm/yy)

Written By: XFydro

Written In: Python

Type: High-Level Language

1. Syntax

Variable Declaration:


Definition: Declares a variable
Syntax: reg data_type var_name var_value

Maximum var_name length: 4

Available Data Types: str, lst, int

Examples:

reg int aaaa 10, reg int abcd 1234, reg str fbgd "Hello World", reg str gdfb "xyz123"

Variable Deletion:


Definition: Deletes all variables or a specific variable
Syntax: reg cls [var_name]

Maximum var_name length: 4

Examples:

reg cls, reg cls var6, reg cls abcd, reg cls f142

Printing in the Console:


Definition: Outputs the specified value to the console
Syntax: prt value

Maximum value length: Undefined

Examples:

prt "Hello World", prt aaaa, prt var1, prt var9

Extracting Variable/List Values & Names:


Definition: Outputs all available variable/list names and values
Syntax: etr data_type

Available Data Types: var, lst

Examples:

etr lst, etr var

Addition:


Definition: Adds a value to a variable and stores the result in the variable
Syntax: add var1 value

Available var type: int

Available value type: int

Examples:

add abcd 400, add var1 1234

Multiplication:


Definition: Multiplies a variable by a value and stores the result in the variable
Syntax: mul var1 value

Available var type: int

Available value type: int

Examples:

mul abcd 2, mul var1 5

Division:


Definition: Divides a variable by a value and stores the result in the variable
Syntax: div var1 value

Available var type: int

Available value type: int

Examples:

div abcd 40, div var1 2

Subtraction:


Definition: Subtracts a value from a variable and stores the result in the variable
Syntax: sub var1 value

Available var type: int

Available value type: int

Examples:

sub abcd 20, sub var1 45

Modulo Operator:


Definition: Divides a variable by a value and stores the remainder in the variable
Syntax: mod var1 value

Available var type: int

Available value type: int

Examples:

mod abcd 20, mod var1 45

Input Command:


Definition: Takes input from the user and stores it in a variable
Syntax: inp var_name "prompt_message"

Maximum var_name length: 4

Available Data Types: str, int

Examples:

inp name "Enter your name:", inp age "Enter your age:"

Conditional Statement - If:


Definition: Executes a block of commands if a condition is true
Syntax: if condition

Available Operators: ==, >, <, >=, <=, !=

Examples:

if aaaa == 10, if var1 > 100

Conditional Statement - Else:


Definition: Executes a block of commands if the preceding 'if' condition is false
Syntax: else

Example:

else

End of Conditional Block:


Definition: Marks the end of an 'if' or 'else' conditional block
Syntax: end

Example:

end

Fetch Command:


Definition: Fetches data from a specified API URL and stores it in the 'output' variable
Syntax: fetch "api_url"

Parameters:

Examples:

fetch "https://api.example.com/data", fetch "https://x3documentation.neocities.org/api"

Exit Command:


Definition: Terminates the program gracefully
Syntax: exit

Example:

exit

2. FAQ

Why Use X³?


The reason to use X³ as a language is a bit unconventional because we don’t actually know its purpose! It’s just a language made for a fun school project.

Why Can't We Use More Than One Parameter Inside a Function in X³?


That’s because I (the developer) was too lazy to do all the work of adding more parameters :P

Why Is the Syntax Updated Every Day?


That’s because I currently have a lot of free time since my exams are over, so I can update it 24/7! :>

Why Is the Syntax Divided Into Pieces Instead of Just Putting Everything in One Place?


Because that would require a lot of hard work, and since this language was made as a project, I’m not trying to code a complex system. A guide will be published on this website soon so anyone can learn the basics properly without struggling to learn it from reverse-engineering.

Why Is the Language Open-Source?


Anyone can access the code, change it, or even re-publish it with modifications. The reason I made it open-source is that everyone should have the right to learn from the code and build upon it.

How Many People Helped in Making This Language?


Uhhh, I am the only one who developed this language. :)

Why Is the Language So Poorly Optimized?


Don’t ask. ;-;