Answer Key
Heads up... You’re accessing parts of this content for free, with some sections shown as
text.
Heads up... You’re accessing parts of this content for free, with some sections shown as
text.Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.
Unlock now
One way to solve the exercise is as follows:
struct ContentView: View {
var body: some View {
Spacer()
VStack {
Text("🟩🟩🟩🟩🟩🟩🟩🐰🟩🟩🟩🟩🟩🟩🟩🟩")
Text("🟩🟧🟧🟧🟧🟧🟧🟧🟩🟧🟧🟧🟧🟧🟧🟩")
Text("🟩🟩🟩🟩🟩🟩🟩🟧🟩🟩🟩🟩🟩🟩🟧🟩")
Text("🟩🟧🟧🟧🟧🟧🟩🟧🟧🟧🟧🟧🟧🟧🟧🟩")
Text("🟩🟧🟩🟩🟩🟧🟩🟩🟩🟩🟩🟩🟩🟩🟧🟩")
Text("🟩🟩🟩🟩🟩🟧🟧🟧🟧🟧🟧🟧🟧🟧🟧🟩")
Text("🟩🟧🟧🟧🟧🟧🟩🟩🟩🟩🟧🟩🟧🟩🟧🟩")
Text("🟩🟧🟩🟩🟩🟧🟩🟧🟧🟧🟧🟩🟧🟩🟧🟩")
Text("🟩🟧🟧🟧🟩🟧🟩🟩🟩🟩🟩🟩🟩🟩🟧🟩")
Text("🟩🟩🟩🟧🟩🟩🟩🟩🟩🟩🟩🟧🟧🟧🟧🟩")
Text("🟩🟩🟩🥕🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩")
}
Spacer()
HStack {
Text("⬆️")
Text("⬇️")
Text("⬅️")
Text("➡️")
}
Spacer()
}
}
Remember: Your version doesn’t have to be identical!