diff --git a/examples/basic/struct0003.ngr b/examples/basic/struct0003.ngr new file mode 100644 index 0000000..ac46800 --- /dev/null +++ b/examples/basic/struct0003.ngr @@ -0,0 +1,27 @@ +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; \ No newline at end of file