aboutsummaryrefslogtreecommitdiff
path: root/test/tests/call.lua
blob: 8549b7f9c8ef4e1ad0bcde623de2161cda51a6d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function afunction()
    print("You called a function!")
end

function anotherfunction(num)
    print("Thanks, I love " .. num .. "!")
    return num == 0 and 1 or anotherfunction(num-1)
end

local function yetanotherfunction(num)
    print("Ew, I don't like " .. num .. ".")
    return num <= 0 and 1 or yetanotherfunction(num/2)
end

afunction()

for k = 100,1000,100 do
    anotherfunction(k)
end

yetanotherfunction(2000)