Factorial in FALSE
Example for versions
Morphett's FALSE,
Wouter's FALSE 1.2.CF
This example uses iterative method of factorial calculation. Variables i
and f
store current number (loop counter) and current factorial value. After the variables are initialized, the loop starts. [i;17=~]
defines the continuation condition: as long as i
doesn’t equal 17. Loop body follows: i
and a string constant are printed, i
is incremented, old value of f
is printed and new value of f
is calculated.
For Wouter’s FALSE 1.2.CF factorial values for 13 and above are calculated with overflow error.
0i: 1f:
[i;17=~]
[i; $."! = " 1+$i: f;$.10, *f:]
#
Comments
]]>blog comments powered by Disqus
]]>