dev/pbs (#8)
Co-authored-by: Nilton Constantino <nilton.constantino@visma.com> Reviewed-on: #8
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { Color, Gfx } from "@sdk:gfx";
|
||||
import { Input } from "@sdk:input";
|
||||
|
||||
fn add(a: int, b: int): int {
|
||||
return a + b;
|
||||
}
|
||||
|
||||
fn frame(): void {
|
||||
// 1. Locals & Arithmetic
|
||||
let x = 10;
|
||||
let y = 20;
|
||||
let z = add(x, y);
|
||||
|
||||
// 2. Control Flow (if)
|
||||
if z == 30 {
|
||||
// 3. Syscall Clear
|
||||
Gfx.clear(Color.GREEN);
|
||||
} else {
|
||||
Gfx.clear(Color.RED);
|
||||
}
|
||||
|
||||
// 4. Input Snapshot & Nested Member Access
|
||||
let p = Input.pad();
|
||||
if p.a.down {
|
||||
Gfx.clear(Color.BLUE);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user