Files
ngr/examples/basic/struct0003.ngr

27 lines
324 B
Plaintext

struct Point {
x: u64;
y: u64;
}
struct Line {
start: Point;
end: Point;
}
function slope(l) -> u64
(l.end.y - l.start.y) / (l.end.x - l.start.x);
test = Line {
start: Point {
x: 1;
y: 2;
};
end: Point {
x: 2;
y: 4;
};
};
foo = slope(test);
print foo;