AssembleScript
AssembleScript is a programming language designed for avengers to write powerful scripts and fight against evil forces. This repository contains it's source code and documentation.
Install / Use
/learn @AssembleProgramming/AssembleScriptREADME
AssembleScript is a programming language designed for avengers to write powerful scripts and fight against evil forces. This repository contains the source code and documentation for AssembleScript.
Supported File-Extensions
The .avenger file extension is commonly used for code written in
AssembleScript.
Here is the demo file for the code written in AssembleScript. download
Setup
Download Node.js. Run this followed commands:
# Clone the Repository
git clone https://github.com/AssembleProgramming/AssembleScript.git
# Install Deno using npm: In the terminal, execute the following command to install Deno globally using npm:
sudo npm install -g deno (MAC)
sudo snap install deno (LINUX)
npm install -g deno (WINDOWS)
# Verify the installation: After the installation is complete, you can verify that Deno has been installed correctly by running the following command:
deno --version
# Run the project
deno run -A main.ts
# Format your entire code with this command
deno fmt
# Add your test code to test.txt
<hr>
<hr>
<hr>
<div align="center">
<h1> 📚 Documentation and Usage Guide </h1>
</div>
KeyWords
The following keywords in AssembleScript have significant references to the Marvel Cinematic Universe:
-
newAvenger(let): In the Marvel universe, new heroes emerge to join forces and fight against evil. Similar to the let keyword, in AssembleScriptnewAvengerrepresents the creation of a new variable, symbolizing the arrival of a new Avenger. -
newEternal(const): The Eternals, a powerful group of immortal beings in the Marvel universe, possess steadfastness and unchanging qualities. Similar to the const keyword,newEternalin AssembleScript signifies the declaration of a constant value that remains immutable throughout the program. -
vision(print): Vision, a synthetic being possessing superhuman abilities, has enhanced vision and perception. In AssembleScript, thevisionkeyword is referred to as print, allowing you to visualize and display output to the console. -
multiverse - madness(switch - case): The Marvel multiverse is a complex web of alternate realities and dimensions. Themultiverse - madnessstatement in AssembleScript represents the ability to navigate through different scenarios, just like traversing the multiverse. Themadnesskeyword within switch case signifies the chaos and unpredictability encountered in different dimensions. -
ifWorthy - otherwise(if - else): AssembleScript embraces the notion of worthiness, a concept frequently explored in the Marvel universe. The if - else construct in AssembleScript is represented byifWorthy - otherwise, where the keywordifWorthyrepresents a condition that must be met to proceed, whileotherwiseoffers an alternative path if the condition is not fulfilled. -
endGame(Break): The Avengers: Endgame movie signifies the culmination of an epic saga and the end of an era. In AssembleScript, the break statement is symbolically referred to asendGame, signifying the end or termination of a loop. -
SHIELD(True): In the Marvel universe, SHIELD (Strategic Homeland Intervention, Enforcement, and Logistics Division) represents an organization dedicated to protecting the world from various threats. In AssembleScript, the true value is denoted bySHIELD, indicating a state of truth or validation. -
HYDRA(False): HYDRA, a secret organization seeking to subvert and manipulate events from within, poses a constant threat in the Marvel universe. In AssembleScript, the false value is symbolized byHYDRA, representing falsehood or negation. -
wakandaForEachloop (ForEach Loop): Wakanda, a technologically advanced nation in the Marvel universe, embraces progress and innovation. The forEach loop in AssembleScript is aptly namedwakandaForEach, signifying an iteration and advancement. -
wakandaForloop (For Loop): The for loop in AssembleScript is aptly namedwakandaFor, signifying an iteration and advancement. -
fightUntilloop (While Loop): Marvel superheroes engage in relentless battles, fighting until they overcome their adversaries. Similarly, the while loop in AssembleScript is referred to asfightUntil, embodying the determination to continue executing a block of code until a condition is met. -
null: In the Marvel universe, the concept of nullifying or negating powers or threats is prevalent. In AssembleScript,nullrepresents the absence of a value or the state of nothingness. -
team(Array): The Avengers, a team of superheroes with diverse abilities, join forces to achieve common goals. In AssembleScript, theteamkeyword represents array, symbolizing the formation of an array or a team of values working together. -
assemble(def): In AssembleScript, theassemblekeyword is used to define function, symbolizing the assembling of your code block. -
snap(return): In AssembleScript, thesnapkeyword is used to return a value, symbolizing the evil snap of Thanos to kill the avengers.
Embrace the spirit of superheroes as you code in AssembleScript, harnessing the power of these keywords to build marvelous programs!
To write scripts in AssembleScript, follow the syntax described blelow. The language supports variables, operators, if-else statements, switch statements, and loops.Here are some important points to keep in mind:
🛡 Variables
Declare variables using the newAvenger keyword followed by the variable name
and initial value.
Declare const using the newEternal keyword followed by the variable name and
value.
Variable name must not contain any number or any other special character
otherthan UNDERSCORE
---INVALID: $thanos, gor69, iamgoblintheno1, @dormamu, %hella
+++VALID: _ironman, captain_america, __moon_knight, spiderman
newAvenger a = "Strange";
newAvenger b = 3000;
newEternal PI = 3.142;
newEternal AI = "Jarvis";
To Print in console use vision()
vision("Love You 3000");
🛡 Switch Statements
Use the multiverse keyword for switch statements. Check the value of a
variable and execute the corresponding madness or the default block.
@@ Instead of break keyword use `endgame`@@
newAvenger name = "iron";
multiverse(name){
madness "captain":
endgame;
madness "iron":
endgame;
default:
endgame;
}
🛡 If-Else Statements
Use the ifWorthy keyword for conditional statements. If the condition is true,
execute the code within the curly braces; otherwise, execute the code in the
otherwise block.
@@ Instead of True keyword use `SHIELD`@@
@@ Instead of False keyword use `HYDRA`@@
newAvenger isTrue = SHIELD;
newAvenger isFalse = HYDRA;
ifWorthy(isTrue){
vision("Hello World!");
}
otherwise{
vision("Hello Thanos!");
}
🛡 Loops
AssembleScript supports for and while loops.
- ForEach Loops Use the
wakandaForEachkeyword for loops. Declare a new variable, specify the condition, and execute the code within the loop. Usestepto increment or decrement the value of iterator.
@@ use blank `vision()` for a newline@@
wakandaForEach(i in 10 to 20){
vision(i);
}
vision();
wakandaForEach(i in 10 to 0 step 2){
vision(i);
}
- For Loops Use the
wakandaForkeyword for loops. Declare a new variable, specify the condition, and execute the code within the loop.
@@ use blank `vision()` for a newline@@
newAvenger i;
wakandaFor(i = 0; i < 20; i = i + 1){
vision(i);
}
- While Loops Use the
fightUntilkeyword for while loops. Specify the condition and execute the code within the loop.
newAvenger i = 0;
fightUntil(i < 10){
vision(i);
i = i + 1;
}
🛡 Arrays
- Array Declaration To declare an array in AssembleScript, use the
teamkeyword followed by the array name and the size of the array in parentheses. Initialize the array with values enclosed in curly braces. Here's an example:
team avengers[4] = {'Captain America', 'Iron Man', 'Thor', 'Hulk'};
- Accessing Array Elements To access individual elements of an array, use square brackets with the index position. Remember, array indices start from 0. Here's an example:
team avengers[4] = {"Captain America", "Iron Man", "Thor", "Hulk"};
newAvenger firstAvenger = avengers[0];
newAvenger secondAvenger = avengers[1];
vision(firstAvenger); $ Output: 'Captain America' $
vision(secondAvenger); $ Output: 'Iron Man' $
- 2D Array Declaration In AssembleScript, you can create a 2D array by nesting arrays within the main array. Here's an example:
team male[10] = {"Captain America", "Iron Man" ,"Dr. Strange", "Hulk", "Hawkeye", "Spiderman", "Thor", "T`Challa", "Ant Man", "Moon Knight"};
team female[7] = {"Black Widow","Captain Marvel","Wanda Maximoff","She Hulk","Ms Marvel","Gamora","Nebula"};
team avenger[2] = {male, female};
vision(avengers[0][4]); $ Output: 'Hawkeye' $
vision(avengers[1][6]); $ Output: 'Gamora' $
🛡 Comments
In AssembleScript, you can add comments to your code to provide explanations, document your intentions, or leave notes for yourself or other developers. Marvel Cinematic Universe-inspired comments in AssembleScript add a touch of superhero flair to your code.
$ Single Line Comments $
$
Multi-line
Comments
$
$ This variable stores the hero's strength $
newAvenger power = 100;
🛡 User Defined Functions
You can create your own user-defined functions in Assemblescript with keyword
assemble and snap resembling def and return k
Related Skills
Writing Hookify Rules
108.4kThis skill should be used when the user asks to "create a hookify rule", "write a hook rule", "configure hookify", "add a hookify rule", or needs guidance on hookify rule syntax and patterns.
review-duplication
100.2kUse this skill during code reviews to proactively investigate the codebase for duplicated functionality, reinvented wheels, or failure to reuse existing project best practices and shared utilities.
mcp-for-beginners
15.8kThis open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
repomix
23.0k📦 Repomix is a powerful tool that packs your entire repository into a single, AI-friendly file. Perfect for when you need to feed your codebase to Large Language Models (LLMs) or other AI tools like Claude, ChatGPT, DeepSeek, Perplexity, Gemini, Gemma, Llama, Grok, and more.
