19 lines
284 B
Plaintext
19 lines
284 B
Plaintext
declare struct Vec2(x: int, y: int)
|
|
[
|
|
(x: int, y: int): (x, y) as default
|
|
(s: int): (s, s) as square
|
|
]
|
|
[[
|
|
ZERO: square(0)
|
|
]]
|
|
{
|
|
pub fn len(self: this): int {
|
|
return x * x + y * y;
|
|
}
|
|
}
|
|
|
|
fn frame(): void {
|
|
let zero = Vec2.ZERO;
|
|
let zz = zero.len();
|
|
}
|