Concatenative language
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); } }] = [[Tal|Uxntal]] = [{@on-reset ( -> ) #0007 fac #010e DEO BRK @fac ( n* -: res* ) ORAk ?{ POP2 #0001 JMP2r } DUP2 #0001 SUB2 fac MUL2 JMP2r}] = [[Titan]] = [{using std.manip using std.cond using std.out fac == [: [/ 1] [: 1 - fac ×] ⍉ 0 = ?] 7 fac .nl}] = [[Modal]] = [{ <> (?0 ?1 `?:) (Int ?:) <> (?n factorial) (Int ?n Int 1 fact) <> (Int 0 Int ?a fact) (?a) <> (Int ?n Int ?a fact) (?n 1 `- ?n ?a `* fact) 6 factorial }]
Describe this revision:
Save