aboutsummaryrefslogtreecommitdiff
path: root/test/tests/call.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-07-01 22:08:45 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-07-01 22:08:45 -0400
commit774b296d3e49b8be3b0feaee8b5d3154fcec73b6 (patch)
treee076254b6332c177dc34b4d87bc222f52ca49646 /test/tests/call.lua
downloadglum-774b296d3e49b8be3b0feaee8b5d3154fcec73b6.tar.gz
glum-774b296d3e49b8be3b0feaee8b5d3154fcec73b6.tar.bz2
glum-774b296d3e49b8be3b0feaee8b5d3154fcec73b6.zip
Initial commit
Diffstat (limited to 'test/tests/call.lua')
-rw-r--r--test/tests/call.lua22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/tests/call.lua b/test/tests/call.lua
new file mode 100644
index 0000000..8549b7f
--- /dev/null
+++ b/test/tests/call.lua
@@ -0,0 +1,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)