Color theme
0 day streak0 XPP1
ElixirLearn mode
MISSION 1 OF 3

Unpack a telescope result

0 XP earned
Elixir track: AdvancedMission: IntermediateTuplesAtomsPattern matching
Before you start this advanced track

Functions and collections. Work with immutable data, tuples, atoms, and pattern matching.

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

x
0 / 6 challenges
LEARN THE CONCEPT

Understand it, then try it.

An Elixir tuple can carry a status atom alongside a message. Pattern matching checks that its shape and status match what the program expects, then binds the message to a variable. The <> operator joins strings. This compact pattern is useful for handling successful results returned by other functions.

observatory.exs
result = {:ok, "aligned"}{:ok, message} = resultreport = "Telescope: " <> messageIO.puts(report)

Each mission is a standalone Elixir script run with elixir. Only standard-library modules are used. Answers describe printed output, excluding any extra value an interactive IEx session would echo.

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