ᴠ
Size: a a a
ᴠ
ᴠ
D
ᴠ
D
ᴠ
ᴠ
D
var = 5 -- comment and variable
if var ~= 1 then -- condition
print(var) -- function call
elseif var > 2 then -- another condition
var = var + 1 -- arithmetic shit
else
print(os.time()) -- getting function from table and call it
end
tbl = {} -- table
tbl.NeededNumber = 1 -- setting the member of table
function PrintTable(tbl) -- Function definition
for key, value in pairs(tbl) do -- for loop
print(key, value)
end
end
PrintTable(tbl) -- call ours function
while true do -- while loop
if math.random(0, 100) > 80 then -- random number generation...
break -- breaking the loop
end
end
ᴠ
D
ᴠ
var = 5 -- comment and variable
if var ~= 1 then -- condition
print(var) -- function call
elseif var > 2 then -- another condition
var = var + 1 -- arithmetic shit
else
print(os.time()) -- getting function from table and call it
end
tbl = {} -- table
tbl.NeededNumber = 1 -- setting the member of table
function PrintTable(tbl) -- Function definition
for key, value in pairs(tbl) do -- for loop
print(key, value)
end
end
PrintTable(tbl) -- call ours function
while true do -- while loop
if math.random(0, 100) > 80 then -- random number generation...
break -- breaking the loop
end
end
D
P
S
S
local isempty = require "table.isempty"
print(isempty({})) -- true
print(isempty({nil, dog = nil})) -- true
print(isempty({"a", "b"})) -- false
print(isempty({nil, 3})) -- false
print(isempty({cat = 3})) -- false
А я всегда для этого использовал next, типаif next(tbl) then bla-bla endJ
J
N