Warning: session_start(): open(/var/lib/php/sessions/sess_3gn886gnnijdl5lg27c0f39m5m, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
-- expects globals grid[], gw, gh
-- uses global r
-- stack layout: {{x, y}, ...}
function fill(stack)
while #stack > 0 do
local x, y = unpack(stack[#stack])
stack[#stack] = nil
if not (x < 0 or y < 0 or x >= gw or y >= gh) then
local idx = y*gw+x+1
if grid[idx] then
grid[idx] = nil
local me = newRectangle(x, y, 1, 1)
if r == nil then
r = me
else
r = mergeRectangles(r, me)
end
stack[#stack+1] = {x-1, y}
stack[#stack+1] = {x+1, y}
stack[#stack+1] = {x, y-1}
stack[#stack+1] = {x, y+1}
end
end
end
end