Skip to content

Releases: pierrelissope/shukascript

ShukaScript v0.2-beta

04 Aug 14:28
2921a03
Compare
Choose a tag to compare

Welcome to ShukaScript! This scripting language is designed to offer simplicity and versatility for a range of programming tasks. Below, you'll find an overview of its key features.

Features

  • Global Variables: Define and use global variables that can be accessed throughout your scripts.

  • Functions:
    Create functions with or without return types. Use variant for dynamic typing.

  • Control Flow:
    Manage the execution flow of your programs with if statements and while loops.

  • Random Number Generation:
    Generate random numbers within a specified range using the random function.

  • Printing:
    Output text and variables to the console with the print function.

  • Custom Functions:
    Define and use custom functions to extend the language’s capabilities and modularize your code.


Example Code

Here is an example script to demonstrate ShukaScript's capabilities:

global_var = 10;

function variant amazingFunction()
{
    print("I have no real utility");
}

function int add(a, b)
{
    return(a + b);
}

function variant main(choice)
{
    if ((choice == 2) || (choice == 4)) {
        print("win");
    }
    if ((choice == 1) || (choice == 3)) {
        print("lose");
    }
    print(add(5, 10));

    random_number = random(5, 10);
    print("The random number is: ", random_number);

    temp_var = random_number;

    while (temp_var < 20) {
        temp_var = temp_var + 1;
        print("Loop iteration");
    }
    amazingFunction();
    print("This is the end", " ", "hope you enjoyed");
    print("MADE BY SHUKABIAT");
}

main(3);
print(global_var + (7 * 9));

Key Concepts Demonstrated

  1. Global Variable
    global_var used in calculations.

  2. Function Definitions

  3. Control Flow:
    Utilizes if statements and while loops.

  4. Random Number:
    Uses random to generate a number within a specified range.

  5. Looping:
    Implements a while loop to repeat actions until a condition is met.

  6. Function calls:

    • amazingFunction(): Prints a simple message.
    • add(a, b): Returns the sum of two numbers.
    • main(choice): Demonstrates control flow, random number generation, and looping.

Enjoy exploring ShukaScript and leveraging its features to simplify and enhance your scripting tasks!

Feel free to adjust any sections or add more specific details as needed!