From 16380f32c41177955ce130c9daefaa7bd4d450aa Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 8 Oct 2024 18:06:19 +0000 Subject: [PATCH] Add demo files --- demo/contents/fact.lua | 8 ++++++++ demo/contents/months.txt | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 demo/contents/fact.lua create mode 100644 demo/contents/months.txt diff --git a/demo/contents/fact.lua b/demo/contents/fact.lua new file mode 100644 index 0000000..a7e0449 --- /dev/null +++ b/demo/contents/fact.lua @@ -0,0 +1,8 @@ +function fact(n, acc) + acc = acc or 1 + if n == 0 then + return acc + end + return fact(n-1, n*acc) +end +print(fact(tonumber(arg[1]))) diff --git a/demo/contents/months.txt b/demo/contents/months.txt new file mode 100644 index 0000000..9b28fd0 --- /dev/null +++ b/demo/contents/months.txt @@ -0,0 +1,12 @@ +August +November +March +January +July +May +October +February +December +April +September +June