H
Size: a a a
H
ВЗ
S
H
S
H
S
sudo apt-get install luarocks
sudo luarocks install luasocket
sudo luarocks install luasec
H
sudo apt-get install luarocks
sudo luarocks install luasocket
sudo luarocks install luasec
S
H
S
S
local set = {
a = true,
b = true,
foo = true
}
if set.foo then ... end
F
emergency = {['78232'] = true, ['7823'] = true, ['7825'] = true}
local lactac = '7823'
if emergency[lactac] then
print "true"
else
print "false"
end
S
S
emergency ='78232','7823','7825'
local lactac = '7823'
if emergency[lactac] then
print "true"
else
print "false"
end
emergency
это не таблица. Ты присваиваешь ей строку '78232'
. Вообще, оно должно было бы упасть, но не падает потому что у строк есть ключи-строковые методы чтобы можно было делать:str = "foo"
print(str:find("o")) --> 2 2
Поэтому у строк как бы можно пытаться взять ключ, но это бесполезно.F
local set = {
a = true,
b = true,
foo = true
}
if set.foo then ... end
S
set[lactac]
. Ты ведь пытаешься выдрать по значению переменной. set.lactac == set['lactac']
, что совсем не set['foo']
, оно же set.foo
.S