7 lines
109 B
Text
7 lines
109 B
Text
|
|
static function factorial(n:Int):Int {
|
||
|
|
var result = 1;
|
||
|
|
while (1<n)
|
||
|
|
result *= n--;
|
||
|
|
return result;
|
||
|
|
}
|