Nudhi Lang Documentation

1. nudhi_ask - User Input

Description: This function prompts the user for input and stores the input into a variable.

Syntax:

nudhi_ask "prompt" variable_name

Parameters:

Example:

nudhi_ask "Enter your name: " username

This example will prompt the user to enter their name and store the value in the variable username.

2. nudhi_say - Output a Variable or Message

Description: This function prints a string or the value of a variable to the console.

Syntax:

nudhi_say "message"
nudhi_say variable_name

Parameters:

Example 1 (Message):

nudhi_say "Hello, World!"

This will print Hello, World! to the console.

Example 2 (Variable):

nudhi_say result

This will print the value of the result variable.

3. nudhi_do - Execute a System Command

Description: This function runs a system command (e.g., shell commands) on the operating system.

Syntax:

nudhi_do "command"

Parameters:

Example:

nudhi_do "echo Hello from Nudhi Lang"

This will execute the shell command to print Hello from Nudhi Lang to the console.

4. nudhi_die - Exit the Program

Description: This function immediately exits the Nudhi Lang program.

Syntax:

nudhi_die

Example:

nudhi_die

This will stop the program and exit the interpreter.

5. Variable Assignment and Math Operations

Description: Variables in Nudhi Lang can be assigned values, and basic math operations can be performed. Currently supported math operations are addition (+), subtraction (-), multiplication (*), and division (/).

Syntax:

variable_name = expression

Parameters:

Example 1:

result = num1 + num2

This example will add the values of num1 and num2 and store the result in result.

Example 2:

area = width * height

This will multiply the values of width and height and store the result in area.

6. Error Handling

Description: If an error occurs (e.g., missing variables or incorrect syntax), Nudhi Lang will print an appropriate error message.

Common Errors: