Discussion, solutions, tips, and bonus material for the Swift Playgrounds Learn to Code Activities:

These videos are intended for students and/or teachers who are interested in taking their programming to the next level.  We discuss one or more possible solutions for each activity and provide extra information on terminology, fundamentals and software design.

We recommend a user put serious effort into solving the Learn to Code activity on their own before consulting these videos.  Robust, long-term learning is best achieved by struggling, failing, and struggling again with the content.  After you have spent sufficient time and effort with the Learn to Code activity, watch the associated video solution and discussion for the activity below.

Compare your solution with ours.  If we presented a solution that was significantly different than yours, and you like it more that the one you produced, wait a few days and revisit the activity, this time trying to reproduce a solution that is different and better than your previous solution.  The extra guided practice you get recreating a solution after receiving feedback from these videos is key to better understanding and better code.

Swift Playgrounds – Learn to Code 1

Commands
  1. Introduction – See Swift Playgrounds Learn to Code iBook for introduction video
  2. Issuing Commands
  3. Adding a New Command
  4. Toggling a Switch
  5. Portal Practice
  6. Finding and Fixing Bugs
  7. Bug Squash Practice
  8. The Shortest Route
Functions
  1. Introduction – See Swift Playgrounds Learn to Code iBook for introduction video
  2. Composing a New Behavior
  3. Creating a New Function
  4. Collect, Toggle, Repeat
  5. Across the Board
  6. Nesting Patterns
  7. Slotted Stairways
  8. Treasure Hunt
For Loops
  1. Introduction – See Swift Playgrounds Learn to Code iBook for introduction video
  2. Using Loops
  3. Looping All the Sides
  4. To the Edge and Back
  5. Loop Jumper
  6. Branch Out
  7. Gem Farm
  8. Four Stash Sweep
Conditional Code
  1. Introduction – See Swift Playgrounds Learn to Code iBook for introduction video
  2. Checking for Switches
  3. Using else if
  4. Looping Conditional Code
  5. Conditional Climb
  6. Defining Smarter Functions
  7. Boxed In
  8. Decision Tree
Logical Operators
  1. Introduction – See Swift Playgrounds Learn to Code iBook for introduction video
  2. Using the NOT Operator
  3. Spiral of NOT
  4. Checking This AND That
  5. Checking This OR That
  6. Logical Labyrinth

 

Swift Playgrounds – Learn to Code 2

Variables
  1. Introduction – See Swift Playgrounds for introduction video
  2. Keeping Track
  3. Bump Up the Value
  4. Incrementing the Value
  5. Seeking Seven Gems
  6. Three Gems, Four Switches
  7. Checking fo Equal Values
  8. Round Up the Switches
  9. Collect the Total
Types
  1. Introduction – See Swift Playgrounds Learn to Code iBook for introduction video
  2. Deactivating a Portal
  3. Portal On and Off
  4. Setting the Right Portal     (alternate solution video)
  5. Corners of the World    (alternate solution video)
  6. Random Gems Everywhere
Initialization
  1. Introduction – See Swift Playgrounds Learn to Code iBook for introduction video
  2. Initializing Your Expert   
  3. (Bonus Video – Introducing Swift Type Extensions)
  4. Train Your Expert
  5. Using Instances of Different Types
  6. It Takes Two
Parameters
  1. Introduction – See Swift Playgrounds Learn to Code iBook for introduction video

 

Building Rainbows Extra Material:

Parameters

  1. Swift Custom Types – Building a Dog Walking Business App