-- Example 1 -- first program.
-- Classic hello program.print("hello")-------- Output ------hello
-- Example 2 -- Comments.
-- Single line comments in Lua start with double hyphen.--[[ Multiple line comments startwith double hyphen and two square brackets. and end with two square brackets. ]]-- And of course this example produces no-- output, since it's all comments!-------- Output ------
-- Example 3 -- variables.
-- Variables hold values which have types, variables don't have types.a=1b="abc"c={}d=printprint(type(a))print(type(b))print(type(c))print(type(d))-------- Output ------numberstringtablefunction
-- Example 4 -- variable names.
-- Variable names consist of letters, digits and underscores.-- They cannot start with a digit.one_two_3 = 123 -- is valid varable name-- 1_two_3 is not a valid variable name.-------- Output ------
-- Example 5 -- more variable names.
-- The underscore is typically used to start special values-- like _VERSION in Lua.print(_VERSION)-- So don't use variables that start with _,-- but a single underscore _ is often used as a-- dummy variable.-------- Output ------Lua 5.1