mirror of
https://github.com/appgurueu/modlib.git
synced 2024-08-19 04:44:11 +02:00
🎃 Halloween Update
This commit is contained in:
parent
11d68ea8b5
commit
b1b2e69b9d
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)
|
||||
end,
|
||||
|
||||
binary_search = function(list, value) -- TODO code this
|
||||
binary_search = function(list, value)
|
||||
local min, size = 1, #list
|
||||
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
|
||||
}
|
||||
@ -636,9 +642,9 @@ file_ext={
|
||||
bridge.output_file:write(message.."\n")
|
||||
--file_ext.append(bridge.input, message)
|
||||
end,
|
||||
process_bridge_start=function(name, command)
|
||||
process_bridge_start=function(name, command, os_execute)
|
||||
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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user