☰
Debian Codegraph
@
1.5.5.8-1
/
/
examples
/
func
/
func_recursion.ck
☽
☼
examples/func/func_recursion.ck
code
plain
raw
GPL-2.0+
2004 Ge Wang and Perry R. Cook. All rights reserved.
debian/copyright
1
// recursive function
2
3
fun int factorial( int x )
4
{
5
if ( x <= 1 ) return 1;
6
else return x * factorial ( x-1 );
7
}
8
9
// call
10
factorial ( 5 ) => int answer;
11
12
// test
13
if ( answer == 120 ) <<<"success">>>;
14