Arrays and Dictionaries

Series Description

Data structures are how coders store and organize entire sets of data. In Lua, data structures are tables. Unlike variables, tables can hold any number of values. Tables can store a list of high scores, a player's inventory, or all of an object's properties. Two types of tables covered in this series are dictionaries and arrays.

Objectives and Prerequisites

Learning Objectives

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

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

Prerequisites

Have a general understanding of variables in Lua.

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

Series Contents

ArticleDescription
Intro to ArraysLearn how to store like groupings of data together with arrays.
Loops and ArraysCombine arrays with loops 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.