Concatenative topics
Concatenative meta
Other languages
Meta
A factorial is a function in mathematics that multiplies a number by every number that precedes it.
int main(){
int x = 7;
printf("The factorial of the number is %d", fac(x));
return 0;
}
int fac(int y)
{
if (y == 0)
return 1;
return y * fac(y - 1);
}@on-reset ( -> )
#0007 fac
#010e DEO
BRK
@fac ( n* -: res* )
ORAk ?{ POP2 #0001 JMP2r }
DUP2 #0001 SUB2 fac MUL2
JMP2r
This revision created on Wed, 20 Mar 2024 15:52:18 by neauoire