← Back to journey

Bring a small lobby to life

Let code do the addition

v7 · Activity 6 of 8 · Scores · 2 min Runs here

Workshop progress · step 6 of 8
Optional learning visualization
Scene choices
Chapter outline
Loading draft…
Activity 6 · Scores

The + symbol adds two numbers. In print(2 + 3), Luau calculates 5 and then displays it.

Without quotation marks, 12 + 8 is a calculation. Inside quotation marks, "12 + 8" is just text.

Your task

Use + inside a print call to display the numeric result of 12 + 8. A calculated value stored in a local variable is also accepted.

Expected output
20

Lines must stay in order. Spelling, capitalization and spaces inside a message matter.

How your work is checked

The required syntax is stated in Your task. The Luau parser checks for addition; the output check verifies the stated result. It does not trace every intermediate variable value.

Syntax in this activity

New syntax: +

Earlier ideas used here
  • numbers
  • printing
What this exercise checks

Actual Output · exact lines and order · extra output forbidden.

Successful execution is required. A compile error, runtime error or execution limit never completes this task.

Whitespace, matching single or double quotes, and different variable names are allowed. Output-only tasks accept any valid Luau solution meeting the displayed result and value types. Construct tasks use the stated straight-line form.

Lesson requirements: addition. These are exercise requirements, not Luau syntax rules.

Compare two programs

Predict which one calculates. Run both to see their actual Output. This experiment does not change your answer.

Calculate a value

print(12 + 8)

Display literal text

print("12 + 8")
Explain this code

Select a word or symbol in this authored example. Your editor draft stays unchanged.

  
Choose a highlighted part to see what it means.
Your goal

Use + inside a print call to display the numeric result of 12 + 8. A calculated value stored in a local variable is also accepted.

Run code to see what happens. Check solution to test the activity.

Reset starter

Replace this code with the starter? Download your draft to keep a copy.

Code

Luau
Luau keyword highlighting · Ctrl/⌘ + Enter: Run · Esc: leave editor

Your output will appear here.

Ready