
Learn the basics of Lua syntax, explore conditionals and loops, use tables to mirror other data structures, then write functions and discover libraries and packages.
Learn Lua, a fast, portable scripting language and glue language that interfaces with C and C++, with simple syntax, tables as the core data structure, and a robust standard library.
Learn to run the Lua standalone interpreter on Windows, Mac, and Linux, execute scripts with lua [options] script [args], and use -e, -l, and -i for quick testing.
Create a simple hello Lua script that prints a greeting, uses a shebang, and handles an optional argument from the script’s arg table, demonstrating basic Lua execution.
Explore Lua control structures, including if-then-else branches and loops while, repeat until, and for (numeric and generic), plus comparison operators and local variables in table iteration with pairs.
Understand tables as Lua’s primary data structure, including arrays and dictionaries with mixed key types. Apply dot and bracket notation for access, and construct arrays without holes with table constructors.
Learn to run Lua code, parse arguments, and convert strings to numbers with tonumber. Build a square table, compare ipairs and pairs, and use while and length-aware loops.
Learn to declare and define functions, compute averages from a table, and return multiple values, including max and average, with vararg support and time-seeded randomness.
Explore Lua's standard libraries, built in C, including basic, module, string, table, math, io, and os, accessed as library.function, with guidance to the Lua 5.3 reference manual and LuaRocks.
The Introduction to Lua course is a 1 - hour course for beginners. In the course, we'll cover the basics of the Lua programming language. By the end of the course, you should have a beginner's working knowledge of how to program in Lua, so this course will prepare you for using Lua in the way you want to, whether that's modding your favorite games, scripting in your OS of choice, or writing libraries for others to use.
Topics include:
So I hope you join us for this Introduction to Lua.