Coding at Home: April 10th

We’re back for day fourteen of coding at home, live today at 1pm, Irish time!

Recap: Types, Types, and More Types!

We’ve spent the last three days going over types in Swift. We could spend another couple dozen, easily, going over types, because they’re such a big part of Swift with a lot of fun aspects to explore.

If you feel like you need more practice we gave you some good pointers yesterday, in the Learn to Code 2 playground, and our work in the Shapes playground should provide you a lot of opportunity to work on initializing instances from types.

Functions with Parameters

As bad as “Initializers” sounded in the previous chapter, “Functions with Parameters” sounds like something Doctor Who might be attacked by.

But we’ve seen (and used) functions with parameters before! In the Turtle Graphics playground, we called the function forward() with a number in between the parentheses to specify how far we wanted the turtle to move forward. Or we used the right() or left() functions with a number to specify the number of degrees we wanted the turtle to turn.

We created functions in previous work because we found ourselves repeating a certain set of tasks. And it made sense to group the code together so we could call it by using just one function call.

By creating (or using) functions with parameters we’re just making our code even more useful.

We’ll spend our time today in a Turtle Graphics playground and the Learn to Code 2 playground.

Feedback

If you can, please fill out our six question, very informal, very anonymous survey so we can get a bit of feedback on the sessions so far.

And if you have any work you’re particularly proud of, feel free to email it to [email protected], we’d love to see your stuff!


Remember to wear your Easter best, bring your iPad and Learn to Code 2, we’ll see you at 1pm!

One thought on “Coding at Home: April 10th”

Leave a Reply

Your email address will not be published. Required fields are marked *