15 lines
236 B
Text
15 lines
236 B
Text
input string "Enter a number:"
|
|
set "in" to "('ABS('input')')"
|
|
if "in" <= 1 then "one"
|
|
set "result" to 1
|
|
|
|
: "factorial"
|
|
set "result" to "('result' * 'in')"
|
|
dec "in" by 1
|
|
if "in" > 1 then "factorial"
|
|
* "('result')"
|
|
end
|
|
|
|
: "one"
|
|
* "1"
|
|
end
|