Lua Quick Guide - tutorialspoint
Basic Tokens in Lua io.write("Hello world, from ",_VERSION,"!\n") Comments -- simple comment --[[ block comments --]] identifiers - λ³μλͺ , ν¨μλͺ λ± κ·μΉ mohd zera abc move_name a_123 myname50 _temp a23b9 retVal Keywords - μμ½μ΄ and break do else elseif end false for function if in local nil not or repeat return then true until while Lua - Variables Global variables, Local bariables, Table fields Variable Example -- Variable definition: local a, b --local g,l = 20,30 --global -- Initialization a = 10 b = 30 print("value of a:", a) print("value of b:", b) -- Swapping of variables b, a = a, b print("value of a:", a) print("value of b:", b) f = 70.0/3.0 print("value of f", f) Data Types nil - no data boolean - ture, false number - read numbers string - array of characters function - method that is written in C or Lua userdata - C data thread - independent threads of execution table - arrays, symbol tables, sets, records, graphs, trees, etc ...