forked from JavaTX/JavaCompilerCore
18 lines
221 B
Plaintext
18 lines
221 B
Plaintext
|
import java.lang.Integer;
|
||
|
|
||
|
class Faculty {
|
||
|
|
||
|
m () {
|
||
|
|
||
|
var fact = (Integer x) -> {
|
||
|
if (x == 1) {
|
||
|
return x;
|
||
|
}
|
||
|
else {
|
||
|
return x * (fact.apply(x-1));
|
||
|
}
|
||
|
};
|
||
|
return fact;
|
||
|
}
|
||
|
}
|