I'm trying to shifts the elements of a table so that every elements goes up and that the first element becomes the last one.
local listTable = function(mesa, up)
local exchange = nil
if up then
exchange = mesa[0]
for i = 1, #mesa do
mesa[i - 1] = mesa[i]
end
mesa[#mesa] = exchange
else
exchange = mesa[#mesa]
for i = #mesa, 1 do
mesa[i] = mesa[i - 1]
end
mesa[0] = exchange
end
end
