We’re live again today at 1pm, still talking about types!
Recap: Types Everywhere!
We went through a LOT of stuff yesterday. A whole new concept with some fancy new language and new ways of writing code.
If we think about our playgrounds so far, we’ve been dealing with lots of different types:
- Our character, who navigates around the puzzle, is a type
- Portals are a type
- Tiles are a type that have an
isOnGem
andisOnClosedSwitch
property
Many of these things, so far, have been hidden to us, to ease us into coding. But as we go on, we’ll see types, and especially instances, in use everywhere in the code we’re writing and reading.
In other playgrounds we’ve used, like the Turtle Graphics playground, the turtle itself (which is a monkey, in our case) is an instance of a Turtle
type.
Our Turtle
type has certain properties, but what we’ve been using it most for is to perform certain actions, by calling methods on the instance. forward()
, left()
and setColor()
are all functions on our type.
We’re going to explore turtles a little more in today’s lesson and we’re also going to open up a type and show you what the guts look like.
We’ll see how useful types are and use them as another way to organize our code.
So join us at 1pm today!