Coding at Home: May 12th, Starting Your Camera

Join us today at 1pm, Irish time on Twitch!

Homework

Well, it’s all homework, at the moment, at least here in Ireland.

But last night’s homework was to finish, as best you can, your design for your camera.

Ideally you’ve spent time in the init method for your MyCamera class, in this section:

It’s going to require adding the components you need at the right Point on the screen and the right Size.

Remember the grid, with the 0,0 point in the center:

x coordinates to the right are zero to 500, and to the left are zero to minus 500 . y coordinates from the center up are zero to 500, and from the center down at zero to minus 500.

If you get stuck, try sketching them out on paper.

Today’s Session

We will work more with connecting our camera buttons and view finders and wiring it all up. We’ll talk about how the messages are sent, which is a big organizational component of programming.

And we’ll review styling our components and how we get things close to our design while also making the thing functional.

Tune in at 1pm to try it out!

Coding at Home: April 22nd, while loops

Catch us today at 1pm, Irish time, for some more live coding!

Recap

We finished up logical operators yesterday with a little BuzzFeed-style quiz. Our code looked a little something like this:

show("What is your name?")
let name = ask("Name")
show("Hi " + name)
show("Answer some questions and I'll tell you what type of animal you are.") 

show("Are you house-trained?")
var isHouseTrained = askForBool()

show("If I threw a ball would you chase it?")
var wouldChaseBall = askForBool()

//🦁🐱🐶🐺
if isHouseTrained && wouldChaseBall {
    print("You're a 🐶!")
} else if !isHouseTrained && wouldChaseBall {
    print("You're a 🐺!")
} else if isHouseTrained && !wouldChaseBall {
    print("You're a 🐱!")
} else if !isHouseTrained && !wouldChaseBall {
    print("You're a 🦁!")
}

Paste that into a Swift Playground on your iPad and try it out!

Today’s Session

Today we’re back with while loops.

They require a little more design thinking, and especially today’s playground, where we nest loops! This just means we’ll be running a loop inside of a loop.

Because this is a little bit of a leap, conceptually, we’re going to take our time and come up with some strategies for reading code that might help you. Not only will they make reading code someone else has written easier, they’ll make reading and explaining your own code later easier. And the tips will help you design your code better, before you even start writing a single line.

If you need to catch up on while loops, feel free to watch (or re-watch) yesterday’s session.

We’ll see you at 1pm!

Coding at Home: April 14th

Welcome back! We’re live streaming again today on Twitch, and you don’t want to miss this session, it’s one of my kids’ personal favorites!

Today’s Session: Functions with Parameters

We’ll keep going with our final playground page in Learn to Code 2 about functions with parameters today. We started on the page yesterday, but today we’ll finish off one of the few possible solutions, and then we’ll move on to yet another new playground.

Let’s Play a Game

After that quick review we’ll move on to our new playground: Rock, Paper, Scissors.

This is an amazing playground for encouraging interaction amongst your students and creativity. The students will build their own game of rock, paper, scissors with emoji and battle it out!

It’s usually one of the more engaging sessions in a class, and hopefully that translates to home, as well.

We’ll see you today at 1pm!