Lua-Beginners-Guide icon indicating copy to clipboard operation
Lua-Beginners-Guide copied to clipboard

Maybe some errors in your readme?

Open woshiZS opened this issue 5 years ago • 1 comments

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

woshiZS avatar Nov 19 '20 11:11 woshiZS

Thanks for letting me know.

pratyush-awasthi avatar Jan 07 '21 05:01 pratyush-awasthi