summaryrefslogtreecommitdiff
path: root/scratch/refresh.lua
diff options
context:
space:
mode:
authorThePrimeAgain <theprimeagain@theprimeagain.com>2025-12-30 06:42:00 -0700
committerThePrimeAgain <theprimeagain@theprimeagain.com>2025-12-30 06:42:00 -0700
commita84da6482b1fd3893748eb866d6ce5cff2843d17 (patch)
tree395e2f9328257ff2160fc36c218e61dbbc96f54b /scratch/refresh.lua
parente34b67e70573ce6f3a5ce1b96c0372b679804cd6 (diff)
downloada4-a84da6482b1fd3893748eb866d6ce5cff2843d17.tar.xz
a4-a84da6482b1fd3893748eb866d6ce5cff2843d17.zip
logger and logging order fixed. no more sort issue
Diffstat (limited to 'scratch/refresh.lua')
-rw-r--r--scratch/refresh.lua22
1 files changed, 21 insertions, 1 deletions
diff --git a/scratch/refresh.lua b/scratch/refresh.lua
index 86eb40d..f4c81c7 100644
--- a/scratch/refresh.lua
+++ b/scratch/refresh.lua
@@ -1,3 +1,23 @@
R("99")
-function fizz_buzz(count) end
+function fizz_buzz(count)
+ local result = {}
+ for i = 1, count do
+ if i % 15 == 0 then
+ vim.list_extend(result, { "FizzBuzz" })
+ elseif i % 3 == 0 then
+ vim.list_extend(result, { "Fizz" })
+ elseif i % 5 == 0 then
+ vim.list_extend(result, { "Buzz" })
+ else
+ vim.list_extend(result, { tostring(i) })
+ end
+ end
+ return result
+end
+
+--- @param numbers number[]
+function sort(numbers)
+ table.sort(numbers)
+ return numbers
+end