Examples

Return Home

Variables

let a = "Hello, World!";
let b = 1.5;
let c = true;
let d = c;

print(a);
print(b);
print(c);
print(d);

// Output

// Hello, World!
// 1.5
// true
// true

Functions

fn yap(str) {
    print(str);
}

yap("Hello, World!");

// Output

// Hello, World!

Imports


// yapper.modu

fn yap(str) {
    print(str);
}

// main.modu

import "yapper.modu" as yapper;

yapper.yap("Hello, World!");

// Output

// Hello, World!

If Statements

let a = 1;
let b = 2;

if a == b {
    print("a is equal to b");
}


if a != b {
    print("a is not equal to b");
}


// Output

// a is not equal to b

Addition and Subtraction

let a = 5;
let b = -5;
let c = a + b;

print(a);
print(b);
print(c);
print(a + b + c + 1);

// Output

// 5
// -5
// 0
// 1