Files
lucia-lang/ex.src
Lucia Ceionia 1f6da72364 Initial commit
2023-05-12 16:54:29 -05:00

44 lines
660 B
Plaintext

extern printfd;
extern puts;
fn ack(m i32 n i32) endvar
if m 0 eq then
n 1+ ret;
elif n 0 eq then
(m 1- 1)ack ret;
else
(m 1- (m n 1-)ack)ack ret;
end
endfn
fn foo(ptr pi32) endvar
ptr* ptr* 1+:=
endfn
fn main(argc i32 argv ppi8)
x y u32;
ptr ppi8;
endvar
0 y=:;
loop
y 4 eq breakif;
0 x=:;
loop
x 4 eq breakif;
((y x)ack)printfd;
(x&)foo
end
y 1 + y=:;
end
x argc :=;
ptr argv :=;
loop
x 0 eq ptr* 0 eq or breakif;
(ptr*)puts;
x 1 - x=:;
ptr 4+ ptr=:;
end
endfn