mirror of
https://github.com/CPunch/Cosmo.git
synced 2024-11-21 23:10:05 +00:00
21 lines
327 B
Lua
21 lines
327 B
Lua
|
local function fact(i)
|
||
|
local total = 1
|
||
|
local x = i
|
||
|
|
||
|
while (x > 1) do
|
||
|
total = total * x
|
||
|
x = x - 1
|
||
|
end
|
||
|
|
||
|
return total
|
||
|
end
|
||
|
|
||
|
local i = 1
|
||
|
while i < 1000 do
|
||
|
local x = 1
|
||
|
while x < 100 do
|
||
|
print("The factorial of " .. x .. " is " .. fact(x))
|
||
|
x = x + 1
|
||
|
end
|
||
|
i = i + 1
|
||
|
end
|