Arrays and Dictionaries

Series Description

In Lua, dictionaries and arrays are two types of data structures used to organize information. While variables can be used to store data, as projects become more complex, coders will often use data structures to meet their goals.

Objectives and Prerequisites

Learning Objectives

Learn common structures for storing sets of information, such as arrays and dictionaries as well as use cases for each structure.

Be able to manipulate data structures, such as adding, removing, or returning values from a structure like an array.


Have a general understanding of variables in Lua.

Feel comfortable typing and using conditional statements (if/else) and loops (for and while).

Series Contents

Intro to ArraysLearn how to store like groupings of data together with arrays.
Loops and ArraysCombine arrays with loops to be able to repeat code with a disappearing path trap.
Making Changes to ArraysAdd and remove values in arrays by coding a script to manage a player's inventory
Intro to DictionariesOrganize complex sets of data with pairs using dictionaries.
Pairs and ipairsIterate through arrays where you may not know the start or end points.
Returning Values from TablesUse pairs and ipairs to retrieve data from arrays and dictionaries.