Color theme
0 day streak0 XPP1
LuaLearn mode
MISSION 1 OF 1

Advance the printmaking queue

0 XP earned
Lua track: BeginnerMission: BeginnerSequence indexingQueue removalSaved values
Before you start this beginner track

Variables, loops, and sequences. Lua sequence indexes start at one.

Guided code reading and debugging. Runnable coding challenges are available in JavaScript, Python, and SQL.

x
0 / 2 challenges
LEARN THE CONCEPT

Understand it, then try it.

A printmaker keeps the next jobs in a sequence table. Read its first entry before removing it, so the program can report both the completed job and the new first job. table.remove closes the gap by shifting later entries down. The saved local variable still contains the original first string.

workshop.lua
local jobs = {"sketch", "ink", "frame"}local finished = jobs[1]table.remove(jobs, 1)print(finished .. " -> " .. jobs[1])

Each mission is a standalone Lua 5.4 script with standard libraries. Tables used as sequences have consecutive integer keys starting at 1 and no gaps. All string examples use ASCII text.

Track the values line by line. Predict the result before running this example in your own editor.