We’ll be practicing our loops with some more Learn to Code 1. We’ll also take a look at a new playground that might spark some ideas about how you’d use loops.
If you’re really ahead of the game, go to https://www.thecodehub.ie/playgrounds/ on your iPad and subscribe to The Code Hub’s Playground feed. We’ll be using the Turtle Graphics – Simplified playground for an example of loops in action.
Chapter 4: Variables
Today we’ll also get set up to tackle a huge new subject: variables.
This means moving on to a new playground from Apple (Learn to Code 2), an app from The Code Hub (Learning Variables).
It’s a big new topic, so we’ll dip in slowly to start.
Both the Google Classroom and discussions board are just a way to make the students feel a little more connected to the material and to each other. It helps to have support, especially when you’re learning something new!
Today we’ll touch on what we did last week, briefly, and then we’ll get into the meat of for loops!
Bill Chapman, of the University of Illinois dropped a nice note with links to his own video resources. So if you want to check them out while you’re going through the Learn to Code Swift Playgrounds you might find them helpful. They’re well worth checking out, because the more time you spend with these playgrounds, the more practice you get, and the better programmer you become!
The beginning of the video will help you get set up, so long as you have an iPad and an internet connection.
If you prefer to read your instructions, yesterday’s post will show you where to go to get Swift Playgrounds and Everyone Can Code Puzzles, the ebook we’re using.
Today’s Session @ 1pm Irish time
For today’s session we’re going to walk through some more lessons about commands: how to use them, how to figure out when they’re not doing what we expected, or debugging. We’ll look at strategies for solving puzzles, which is a lot of what programming is.
So tune in, grab your iPad, and spend a little time with me, coding!
We’ll be working from the student guide, but if you’re a parent (or a kid teaching another kid, your parent, or your pets), the teacher guide gives some great suggestions about how to teach coding, with varying levels of difficulty.
So hopefully I’ll see you at 1pm, Irish time, today.
The playground is designed to take advantage of a little library I wrote that models a story with a number of rooms, through which your protagonist navigates. The goal is to use coding to be a little bit creative and get the kids (and adults) telling stories and using code as a means to and end, rather than the end, itself.
Getting the Playground
To start, go grab the playground from the Code Hub’s Playgrounds feed (explained in Part Two). You’ll see the Text Adventure playground front and center now:
Once you have that in Playgrounds, you can open it and you’ll see the introduction to the whole shebang.
Pretty self-explanatory so far, right?
We don’t have to write any code at all, just hit the “Run My Code” button and off we go!
I won’t post any spoilers here, but the stories are gripping, edge-of-your-seat kind of stuff.
Once you’ve exhausted all the possibilities in the first story (and that might happen pretty quick), you can hit the Next button to move on.
The playground is designed to dip you into coding your own story gently and follows a progression that looks like this:
You can skip around if you like, of course, but I try to introduce concepts that will introduce you to code and the features of the Story library as we go. So try it out. If you come up with a particularly cool twist or story of your own, use the built-in tools to record your story.
From the three dots in the menu, select Record Movie to start capturing your story.
One last tip, the stories work best in fullscreen mode. You can enter fullscreen by tapping on the divider between your code and the story view.
Drag to the left, and the story view will take up the full screen. To get out of full screen you’ll just tap on the left side of the screen (you might see the faint arrow on that edge).
In Part One, we looked at a relatively painless way to talk about and experience variables.
Swift Playgrounds from The Code Hub
One of the other little tweaks we’ve just shipped is an update to our Text Adventure Playground. But let’s start with a little (re)introduction of Playgrounds, for the uninitiated.
If you didn’t already know, The Code Hub has a suite of Swift Playgrounds for use in the iPad (and now Mac!) Playgrounds app. When you download Playgrounds, which is a free download, you’ll see a bar along the bottom of the screen with the headline “More Playgrounds.”
Apple provides an excellent array of playgrounds authored to teach you how to code, to learn augmented reality development. Or some innovative uses of content and code like the Cipher playground. The app is free, as are playgrounds you can download from Apple and third parties (like The Code Hub).
But if you are on an iPad and go to https://thecodehub.ie/playgrounds/ you can click on the Subscribe button to add The Code Hub’s suite of playgrounds to the app. Alternatively, on the Mac version of Playgrounds you can scroll to the bottom of the additional playgrounds and you’ll see the option to enter a subscription URL:
Enter in www.thecodehub.ie/playgrounds/feed.json and you’ll be good to go. You’ll see a confirmation dialog like this:
And, once you hit Subscribe, you’ll see a list of our playgrounds.
Right now, the 18th of March, 2020, we have six. I’ll try and touch on each of them in the next few weeks. But for now, you can download any of them onto your device and play around with them. There is a bit of explanatory text for each of the playgrounds, so you won’t be left completely at sea.
It helps to have a bit of Swift knowledge, but that, too, I’ll be touching on in the coming weeks.