dx
Learn Lua in 15 Minutes

more or less For a more in-depth Lua tutorial, watch this video or check out a transcript of the video . -- Two dashes start a one-line comment. --[[ Adding two ['s and ]'s makes it a multi-line comment. --]] ---------------------------------------------------- -- 1. Variables and flow control. ---------------------------------------------------- num = 42 -- All numbers are doubles. -- Don't freak out, 64-bit doubles have 52 bits for -- storing exact int values; machine precision is -- not a problem for ints that need < 52 bits. s = 'walternate' -- Immutable strings like Python. t = "double-quotes are also fine" u = [[ Double brackets start and end multi-line strings.]] t = nil -- Undefines t; Lua has garbage collection. -- Blocks are denoted with keywords like do/end: while num < 50 do num = num + 1 -- No ++ or += type operators. end -- If...

Linked on 2015-07-19 05:13:18 | Similar Links