local latitude = -42
-- Скобки допустимы, но не нужны
local location
if (latitude == 0) then
location = "Equator"
elseif (latitude < 0) then
location = "Southern Hemisphere"
else
location = "Northern Hemisphere"
end
-- location = Southern Hemisphere
-- Весь if в одной строке
local sign = "+"
if latitude < 0 then sign = "-" end
-- sign = -
-- else if открывает вложенный if со своим end
local side
if latitude == 0 then
side = "none"
else
if latitude < 0 then
side = "south"
else
side = "north"
end
end
-- side = south
print("location = " .. location)
print("sign = " .. sign)
print("side = " .. side)