big-moving.ru/api/soft/Ace/demo/kitchen-sink/docs/io.io

6 lines
140 B
Io
Executable File

// computes factorial of a number
factorial := method(n,
if(n == 0, return 1)
res := 1
Range 1 to(n) foreach(i, res = res * i)
)