pr 08 lsp
This commit is contained in:
@@ -1,11 +1,42 @@
|
||||
import { Color, Gfx } from "@sdk:gfx";
|
||||
import { Input } from "@sdk:input";
|
||||
|
||||
declare struct Vec2(x: int, y: int)
|
||||
[
|
||||
(x: int, y: int): (x, y) as default { }
|
||||
(s: int): (s, s) as square { }
|
||||
]
|
||||
[[
|
||||
ZERO: square(0)
|
||||
]]
|
||||
{
|
||||
fn getX(self: this): int {
|
||||
return x;
|
||||
}
|
||||
|
||||
fn getY(self: this): int {
|
||||
return y;
|
||||
}
|
||||
}
|
||||
|
||||
fn add(a: int, b: int): int {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
fn is_higher(a: int, b: int): bool {
|
||||
let c: int = a + b;
|
||||
return c >= 30;
|
||||
}
|
||||
|
||||
fn add2(a: int, b: int): int {
|
||||
let c = add(a, b);
|
||||
return c;
|
||||
}
|
||||
|
||||
fn frame(): void {
|
||||
let zero = Vec2.ZERO;
|
||||
let zz = add(zero.getX(), zero.getY());
|
||||
|
||||
// 1. Locals & Arithmetic
|
||||
let x = 10;
|
||||
let y = 20;
|
||||
|
||||
Reference in New Issue
Block a user