-- defines a factorial functionfunctionfact(n)if n == 0thenreturn1elsereturn n * fact(n -1)
endend
print("input a number:")
a = io.read("*n")
print(fact(a))
The following words are reserved; we cannot use them as identifiers:
andendiforuntilbreakfalseinrepeatwhiledo goto localreturnelsefornilthenelseiffunctionnottrue