mirror of
https://github.com/appgurueu/modlib.git
synced 2025-02-16 16:22:30 +01:00
🎃 Halloween Update
This commit is contained in:
14
init.lua
14
init.lua
@ -376,10 +376,16 @@ table_ext= {
|
|||||||
return table_ext.best_value(table, function(v, m) return v > m end)
|
return table_ext.best_value(table, function(v, m) return v > m end)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
binary_search = function(list, value) -- TODO code this
|
binary_search = function(list, value)
|
||||||
local min, size = 1, #list
|
local min, size = 1, #list
|
||||||
while size > 1 do
|
while size > 1 do
|
||||||
local pivot = math.floor(max - min / 2)
|
local s_half = math.floor(size / 2)
|
||||||
|
local pivot = min + s_half
|
||||||
|
local element = list[pivot]
|
||||||
|
if value > element then
|
||||||
|
min = pivot
|
||||||
|
end
|
||||||
|
size = s_half
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
@ -636,9 +642,9 @@ file_ext={
|
|||||||
bridge.output_file:write(message.."\n")
|
bridge.output_file:write(message.."\n")
|
||||||
--file_ext.append(bridge.input, message)
|
--file_ext.append(bridge.input, message)
|
||||||
end,
|
end,
|
||||||
process_bridge_start=function(name, command)
|
process_bridge_start=function(name, command, os_execute)
|
||||||
local bridge=file_ext.process_bridges[name]
|
local bridge=file_ext.process_bridges[name]
|
||||||
os.execute(string.format(command, bridge.output, bridge.input, bridge.logs))
|
os_execute(string.format(command, bridge.output, bridge.input, bridge.logs))
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user