Incomplete Puzzles
30 September, 2020
As you work through the Swift Fundamentals playgrounds to learn the syntax and core concepts of Swift, it can be nice to take a little break from taking in new ideas, and instead consolidate your understanding by engaging with some puzzles.
That's what these "incomplete puzzles" are all about – a brief detour to engage your brain!
You are encouraged to discuss the puzzles with other students in class, but both students should author solutions, and be able to accurately describe how a solution works.
To get started, here's how to get a local copy of the remote repository from my account on GitHub.
Once you have your own local copy of the repository, create a pointer to a remote repository in your account on GitHub.
Why have pointers to two remotes? That is, one remote in my account (Mr. Gordon), and one remote in your account? With that setup, you can pull updates (new puzzles) from my GitHub account as they are added in the future. And, you can push updates to your own remote to save your work. Here's an example of what that looks like.
One final note – you'll quickly observe that these puzzles, while hopefully interesting, are not an example of authentic learning. They are meant to be little diversions, something to have fun with, something you can write about for your portfolio to show evidence of additional mastery of skills, but they are absolutely not the primary focus of this course.
Once you finish the Swift Fundamentals playgrounds, these puzzles are "done" and it's full steam ahead on learning the skills you need to create an app of your own design. 🚂
Let's get started. Have fun! 🚀
Trident
In this introduction to the Trident puzzle, I'll explain how to use the Xcode debugger to step through code one line at a time. This can be helpful for tracking down bugs, or slowing things down so you can understand what the code is doing.
The Cell Sell
An overview of The Cell Sell puzzle, with another visit to the Xcode debugger. The introduction will finish by prompting you to consider that it is necessary to test program input, and verify correct output, across several possible scenarios.
Handling Incorrect User Input
This deep dive explains how to handle situations where the user does not provide valid input.
This tutorial shows you how to handle incorrect input through a type extension, which helps you avoid using the very bad habit of copying and pasting identical logic throughout your code.