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

Catalog a ceramic bowl

0 XP earned
Swift track: IntermediateMission: IntermediateStructsValue typesMutability
Before you start this intermediate track

Functions and collections. Work with structs, mutable bindings, and optionals.

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.

A pottery catalog keeps related details in a struct. Its stored properties describe one bowl. Swift structs are value types: a constant instance cannot have its properties changed, even if the properties use var. Declaring both the instance and its fired property with var allows the catalog to record the kiln result.

Quest.swift
struct Bowl {    var glaze: String    var fired: Bool}var piece = Bowl(glaze: "blue", fired: false)piece.fired = trueprint("\(piece.glaze): \(piece.fired)")

Run each mission independently as a Swift 5.9 or later script or playground. Top-level statements execute directly; these examples need only the Swift standard library and no Apple UI frameworks.

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