Files
fz-lang/tests/programs/pos_class.fzs
T
2026-10-21 04:00:03 +03:00

26 lines
321 B
Plaintext

class Point
{
int x;
int y;
fn move(int dx, int dy)
{
this.x = this.x + dx;
this.y = this.y + dy;
}
}
Point point = new Point;
point.x = 1;
point.y = 2;
point.move(9, 8);
if (point.x == 10 && point.y == 10)
printline("class method passed");
else
{
printline("class method failed");
exit(1);
}