Lua-Beginners-Guide
Lua-Beginners-Guide copied to clipboard
Maybe some errors in your readme?
In variable part, there is no need to declare _G. before a global variable, instead the interpreter will return error. In the first part of loops, there is an infinite loop in your code: before:
local i = 0
local count = 0
while i <= 10 do
count = count + 1
end
print("count is " .. count) --count is 7
Maybe you can changed this like below.
local i = 0
local count = 0
while i <= 10 do
i = i + 1
count = count + 1
end
print("count is " .. count) --count is 7
Thanks for letting me know.