Exercises and Independent Challenges
This document collects the Independent Challenges and extra practice exercises for the Dice Foundry course. It has one section for each chapter from 1 to 14. It contains no answers. Answers are in the separate Exercise Solutions and Answer Key.
What is in each chapter's section
| Part | What it gives you |
|---|---|
| Independent Challenge(s) | The challenge restated, with its goal, requirements and acceptance criteria. |
| Hint 1, Hint 2, Hint 3 | Progressive hints. Hint 1 is a nudge. Hint 3 is close to the answer but never the full code. |
| Extra Practice | Short exercises of four kinds: predict the output, spot the bug, trace the code, and make a small modification. |
Chapter 14 is different: it is a final project with required features and acceptance criteria, and its hints are organized by feature.
How to work through a challenge
- Re-read the challenge's requirements and acceptance criteria. Write down in one sentence what "done" looks like.
- Work without hints first. Decide which file and which layer owns the change before you type.
- If you are stuck for more than a few minutes on the same problem, read Hint 1 only. Try again.
- Read Hint 2, then Hint 3, only when you need them. Notice how much help you needed; that tells you what to review.
- Build and run. Check every acceptance criterion by hand, not just that the app builds.
- Only then open the Answer Key and compare. Your solution may differ and still be correct. The Answer Key explains alternatives.
Do challenges on a Git branch
A challenge changes your project. The next chapter begins from the reference version of the guided project, so keep your challenge work separate.
Before you start a challenge, commit your finished chapter, then create a branch. Replace NN with the chapter number, for example challenge-05:
git switch -c challenge-NN
When you are finished, whether or not you solved everything, commit the branch if you want to keep the work, then return to the main line before you start the next chapter:
git switch main
The course assumes your main branch is called main. If git branch shows a different name, use that name.
Extra practice exercises
The extra exercises use the playground blocks from Chapter 2 or small changes to your project. Write your prediction before you run anything. A prediction that turns out wrong is the most useful result: find out why it was wrong before you move on.
Exercises that use #Playground blocks need Xcode 26 or later, as in Chapter 2. Put them in your practice file, not in the files of the app.
A note on honesty
Where the Answer Key says that a solution was compiled with 0 errors and 0 warnings, the author really compiled it, with Xcode 27.2 and an iOS 17.0 deployment target. Where it says "Not compile-tested", the author did not, and you should build it yourself. Neither statement claims that anything was tested on a physical device.
Using an AI assistant on exercises
Challenges are the place where an AI assistant is most likely to cut your learning short. If you use one, use the tutor prompt in the Student Workbook, which tells the assistant to give hints and not solutions. Try the challenge yourself first. If you compare your solution with an AI's, ask it to explain every line you did not write.