Catalog a ceramic bowl
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.
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.
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.