Skip to content

sleepy-monax/udfore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

udfore

take println from io;

type Vector
{
    int x;
    int y;
    int z;

    constructor (float x, float y, float z)
    {
        .x = x;
        .y = y;
        .z = z;
    }

    operator + (Vector vector) -> Vector
    {
        return Vector(
            x + vector.x,
            y + vector.y,
            z + vector.z,
        );
    }

    cast String
    {
        return `[{x}, {y}, {z}]`;
    }
}

let v1 := Vector(1, 2, 3);
let v2 := Vector(4, 5, 6);
let v3 := v1 + v2;

println(`{v1} + {v2} = {v3}`);

About

🔣 A safe and statically typed programming language

Topics

Resources

License

Stars

Watchers

Forks