34 lines
540 B
Text
34 lines
540 B
Text
include 'std/std.fa'
|
|
|
|
fun recurse [ int ] int eo
|
|
"Hello" %puts
|
|
|
|
copy -- (arg; arg)
|
|
1 sub -- (arg - 1; arg)
|
|
0 -- (0; arg - 1; arg)
|
|
eql -- (?(0 == arg - 1); arg)
|
|
|
|
if -- return arg
|
|
ret
|
|
else -- return hello(arg - 1)
|
|
1 swap sub #recurse
|
|
end
|
|
end
|
|
|
|
fun main [ str str int ] eo
|
|
3 #recurse
|
|
|
|
copy
|
|
|
|
1 eql if
|
|
"Recursion passed, nice" %puts
|
|
|
|
pop
|
|
%EXIT_SUCCESS %exit
|
|
else
|
|
"Recursion is being weird..." %error
|
|
%exit
|
|
end
|
|
end
|
|
|
|
#main
|