Factorial: Difference between revisions

Content added Content deleted
Line 10,858: Line 10,858:
=={{header|YAMLScript}}==
=={{header|YAMLScript}}==
<syntaxhighlight lang="yaml">
<syntaxhighlight lang="yaml">
#!/usr/bin/env ys-0
!yamlscript/v0


defn factorial(x):
defn main(n):
say: "$n! = $factorial(n)"
apply *: 2..x


say: factorial(20)
defn factorial(x):
apply *: 2 .. x
</syntaxhighlight>
</syntaxhighlight>