Factorial: Difference between revisions

Content added Content deleted
Line 6,048: Line 6,048:
=== Recursive ===
=== Recursive ===
<syntaxhighlight lang="langur">
<syntaxhighlight lang="langur">
val factorial = fn x: if(x < 2: 1; x * self(x - 1))
val factorial = fn x: if(x < 2: 1; x * fn((x - 1)))
writeln factorial(7)
writeln factorial(7)
</syntaxhighlight>
</syntaxhighlight>