Logo Lanfrica

silivestir/Swahili

Domaine:

natural language processing

Type de record:

software
Créateur:
sil
Hôte:
Swahili programming language for tanzanians who speaks swahili inspired by php ```markdown # kiswahiliScript Documentation ### Language: kiswahiliScript **Version:** Crafted in April 2023 **Authors:** Silivestir Assey, Isack Wagunda **Contact:** - Silivestir Assey: silivestirassey@gmx.com - Isack Wagunda: mwlwaphysicsict@gmail.com **Contributions:** Open for contributions --- ## Language Constructs ### Function Functions in kiswahiliScript are defined using the `kazi` keyword. Functions encapsulate a block of code that performs a specific task and can be called from other parts of the code. ```kiswahiliScript kazi FunctionName() { // Function body } ``` **Example:** ```kiswahiliScript kazi Salamu() { elementi("id,output").kontentiNdani("Habari!"); } ``` ### Array Arrays in kiswahiliScript are declared using the `Data` type and are used to store multiple values in a single variable. ```kiswahiliScript Data arrayName [] ``` **Example:** ```kiswahiliScript Data numbers [] numbers = [1, 2, 3, 4, 5] ``` ### Object Objects are used to group related data and functions together. In kiswahiliScript, objects can be created and manipulated using specific syntax. ```kiswahiliScript Data myObject = { key1: value1, key2: value2 } ``` **Example:** ```kiswahiliScript Data person = { jina: "Ali", umri: 30 } ``` ### Variable Variables in kiswahiliScript are used to store data. They are declared with a type or inferred from the assigned value. ```kiswahiliScript namba variableName = value ``` **Example:** ```kiswahiliScript namba age = 25 ``` ### Math Operations kiswahiliScript supports standard arithmetic operations such as addition, subtraction, multiplication, and division. ```kiswahiliScript namba result = 5 + 3 // Addition result = 10 - 2 // Subtraction result = 4 * 2 // Multiplication result = 8 / 2 // Division ``` ### Cosine and Sine (cos, sin) The `cos` and `sin` functions are used to compute the cosine and sine of an angle in radians, respectively. ```kiswahiliScript namba angle = 1.57 // Radians namba cosineValue = cos(angle) namb …

Languages