© 2026 Dometrain. All rights reserved.
Learn Lua from scratch by writing small functions in the browser that work with numbers, text, conditions, loops, and tables.
If you have never written a program and want a small language to start with, this course teaches you the parts of Lua you need first: functions, numbers, strings, conditions, loops, and tables. Every lesson is a short exercise in the browser. You write a Lua function, press Run, and your function is called with several inputs and its results compared with the expected ones, so you know straight away whether it works.
You start with functions, strings, and numbers, including the difference between / and // and why Lua shows 3.0 for some results. Next come comparisons, if statements, and the rule that only nil and false count as false, which is what lets tonumber and or give you a safe default value. The loops chapter covers numeric for, while, and repeat ... until, and finishes by walking through the characters of a string.
The second half is about tables, the only data structure Lua has. You use them as arrays with ipairs, table.insert, table.sort, and table.concat, pass your own comparison function to sort in a custom order, then use tables as records and dictionaries to count words, remove entries, and rank results by how often they appear. The course suits complete beginners, and anyone who wants a plain, practical start with standard Lua 5.4.