An ordered set of instructions. It reads input, follows rules, and produces output.
Loading...
Loading...
Workspace
game scripting embedded automation and lightweight tools
Definition first
Lua is a programming language for writing exact instructions, often used for game scripting embedded automation and lightweight tools. Start with one mental model: input goes through steps and becomes output.
main.luaRun lua main.luaHabit Keep tables simple and print state often while scriptingAn ordered set of instructions. It reads input, follows rules, and produces output.
A value is data. A variable is the name you use to hold and reuse that data.
A named piece of work. It takes input, does one job, and can return a result.
Lua is the place that actually runs code from main.lua.
First readable code
print(42)
Output 42Language lineage
See where Lua comes from, which languages feel close, and what to learn next.
game scripting, embedded configuration, and small extension languages
Zero base path
Question bank
Pick a stage or search across the open programming bank. Jump straight to the matching drill.
Lua question 1. Choose the statement that matches printing a value.
Lua question 2. Choose the statement that matches naming a value.
Lua question 3. Choose the statement that matches reusable function.
Lua question 4. Choose the statement that matches basic collection.
Lua question 5. Choose the statement that matches printing a value.
Lua question 6. Choose the statement that matches naming a value.
Lua question 7. Choose the statement that matches reusable function.
Lua question 8. Choose the statement that matches basic collection.
Lua question 9. Choose the statement that matches printing a value.
Lua question 10. Choose the statement that matches naming a value.
Lua question 11. Choose the statement that matches reusable function.
Lua question 12. Choose the statement that matches basic collection.
Lua question 13. Choose the statement that matches printing a value.
Lua question 14. Choose the statement that matches naming a value.
Lua question 15. Choose the statement that matches reusable function.
Lua question 16. Choose the statement that matches basic collection.
Lua question 17. Choose the statement that matches printing a value.
Lua question 18. Choose the statement that matches naming a value.
Multiple choice
Lua question 1. Choose the statement that matches printing a value.
print(42)
Reference
lua main.luaentry point output syntax print
print(42)
variables assignment types local
local total = 42 print(total)
function collection Table
function add(a, b)
return a + b
end
local scores = {40, 2}
print(#scores)