9 lines
136 B
AppleScript
9 lines
136 B
AppleScript
|
|
-- factorial :: Int -> Int
|
||
|
|
on factorial(x)
|
||
|
|
if x > 1 then
|
||
|
|
x * (factorial(x - 1))
|
||
|
|
else
|
||
|
|
1
|
||
|
|
end if
|
||
|
|
end factorial
|