Engine

Loops

Series Description

In computer science, loops are a common feature in many scripts, often used to repeat sets of code. This series will cover two of the most common loops: for and while loops.

Objectives and Prerequisites

Learning Objectives

Understand situations where loops are useful as opposed to alternative forms of writing a script.

Be able to write out for and while loops, while identifying the syntax for both.

Prerequisites

Have a general understanding of variables in Lua.

Series Contents

ArticleDescription
Repeating Code with while LoopsLearn how to repeat code to create a color changing part.
Intro to For LoopsUse a common loop that repeats instructions for a set amount of times.
Loops Practice: Glowing Lights with For LoopsPractice using for loops by making lights glow.
Loops Practice: Creating a Timed BridgeA more advanced implementation of a for loop that makes a bridge disappear and reappear.
Nesting LoopsAdd a loop within a loop for more complex behavior and code.