Skip to main content
1 of 2
Kroppeb
  • 1.7k
  • 9
  • 11

Brachylog, 7 bytes

By making a range and multiplying it

0∧1|⟦₁×

Explanation

0           --  If n == 0:
 ∧1         --      return 1
|           --  Else:
 ⟦₁         --      Construct the range [1,n]
   ×        --      return the product of said range

Try it online!


Brachylog, 11 bytes

recursion

0∧1|-₁↰;?×

Explanation

            --f(n):
0           --  if n == 0:
 ∧1         --      return 1
|           --  else:
 -₁↰        --      f(n-1)
    ;?×     --            *n

Try it online!

Kroppeb
  • 1.7k
  • 9
  • 11