From ec91aab02442dbbf577fa8d8e68c79a09b55f3f9 Mon Sep 17 00:00:00 2001 From: ame Date: Thu, 12 Jun 2025 02:08:47 -0500 Subject: rename 'array' lib and small additions --- library/lullaby/table.lua | 72 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 library/lullaby/table.lua (limited to 'library/lullaby/table.lua') diff --git a/library/lullaby/table.lua b/library/lullaby/table.lua new file mode 100644 index 0000000..51414f7 --- /dev/null +++ b/library/lullaby/table.lua @@ -0,0 +1,72 @@ +---@meta + +---to be rewritten +---@class lullaby.table +local table = {} + +---splits string into smaller strings, removing the delimiter +---```lua +---llby.table.split("/hello/world//test///", "/") -- {"hello", "world", "test"} +---llby.table.split("/hello/world//test///", "/", false) -- {"hello", "world", "", "test", "", "", ""} +---``` +---@param haystack string +---@param search string +---@param skip boolean? whether or not to skip empty chunks +---@return string[] +function table.split(haystack, search, skip) end + +---greatest, least +---@deprecated +---@param array number[] +function table.quicksort(array) end + +---greatest, least +---@deprecated +---@param array number[] +function table.mergesort(array) end + +---greatest, least +---@deprecated +---@param array number[] +function table.shellsort(array) end + +---greatest, least +---@deprecated +---@param array number[] +function table.bubblesort(array) end + +---greatest, least +---@deprecated +---@param array number[] +function table.heapsort(array) end + +---least, greatest +---@deprecated +---@param array integer[] +function table.countintsort(array) end + +---dont use this lol +---@deprecated +---greatest, least +---@param array number[] +function table.miraclesort(array) end + +---dont use this lol +---@deprecated +---greatest, least +---@param array number[] +function table.stalinsort(array) end + +---dont use this lol +---@deprecated +---greatest, least +---@param array number[] +function table.slowsort(array) end + +---dont use this lol +---@deprecated +---greatest, least +---@param array number[] +function table.bogosort(array) end + +return table -- cgit v1.2.3