mama-language
v1.0.7
Published
A fun programming language
Downloads
13
Maintainers
Readme
MAMA Language
Introduction
MAMA is a fun programming language based on JavaScript. You can install the MAMA extension from the VS Code marketplace for syntax highlighting, and you're good to go. Enjoy coding with MAMA! 🚀😊
Installation
You can install the MAMA language using npm.
npm install mama-language
Example
A MAMA programming language file is created with .mama extension.
mama aitu a = 7;
mama aitu b = 8;
mama aitu change hba pare sum;
sum = a * b;
mama saok (sum > 40) {
mama.kok("Bor Bor Dangor");
} jdi nohoi mama saok (sum > 20) {
mama.kok("Bor Dangor");
} jdi nohoi {
mama.kok("Bor Xoru");
}
Creating a variables
- mama aitu - Declare a variable. For example:
mama aitu a = 7;
- mama aitu change hba pare - Declare a variable which can be changed. For example:
mama aitu change hba pare sum;
Conditional Statements
- mama saok (condition) { ... } jdi nohoi { ... } - If-else statement. For example:
mama saok (sum > 20) {
mama.kok("Bor Dangor");
} jdi nohoi {
mama.kok("Bor Xoru");
}
- mama saok (condition) { ... } jdi nohoi mama saok (condition) { ... } jdi nohoi { ... } - else-if statement. For example:
mama saok (sum > 40) {
mama.kok("Bor Bor Dangor");
} jdi nohoi mama saok (sum > 20) {
mama.kok("Bor Dangor");
} jdi nohoi {
mama.kok("Bor Xoru");
}
Loop Statements
- mama ghura (initialization ; condition ; increment/decrement) { ... } - For loop statement. For example:
mama ghura (mama aitu change hba pare i = 0; i < 5; i = i + 1) {
mama saok (i === 3) {
mama jai thakok;
}
mama.kok("Testing " + i);
}
- mama rkhi jaok - Used to break the loop. For example:
mama ghura (mama aitu change hba pare i = 0; i < 5; i = i + 1) {
mama saok (i === 3) {
mama rkhi jaok;
}
mama.kok("Testing " + i);
}
- mama mama jai thakok - Used to break one iteration and continue with the next iteration. For example:
mama ghura (mama aitu change hba pare i = 0; i < 5; i = i + 1) {
mama saok (i === 3) {
mama mama jai thakok;
}
mama.kok("Testing " + i);
}
Running the MAMA Language
To run MAMA language files, add the following script to your package.json:
"scripts": {
"start": "node node_modules/mama-language/src/mamaRunner.js"
}
Now, you can run your MAMA files using the following command:
npm start index.mama