big-moving.ru/assets/vendor_plugins/ace-builds-master/demo/kitchen-sink/docs/io.io

6 lines
140 B
Io
Raw Normal View History

2022-06-24 15:29:23 +05:00
// computes factorial of a number
factorial := method(n,
if(n == 0, return 1)
res := 1
Range 1 to(n) foreach(i, res = res * i)
)