diff options
| author | ThePrimeAgain <theprimeagain@theprimeagain.com> | 2025-12-30 06:42:00 -0700 |
|---|---|---|
| committer | ThePrimeAgain <theprimeagain@theprimeagain.com> | 2025-12-30 06:42:00 -0700 |
| commit | a84da6482b1fd3893748eb866d6ce5cff2843d17 (patch) | |
| tree | 395e2f9328257ff2160fc36c218e61dbbc96f54b /scratch | |
| parent | e34b67e70573ce6f3a5ce1b96c0372b679804cd6 (diff) | |
| download | a4-a84da6482b1fd3893748eb866d6ce5cff2843d17.tar.xz a4-a84da6482b1fd3893748eb866d6ce5cff2843d17.zip | |
logger and logging order fixed. no more sort issue
Diffstat (limited to 'scratch')
| -rw-r--r-- | scratch/refresh.lua | 22 |
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 |
