We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Vectors

We have arrived at our first container type! What makes VECTOR3 not like the other types is that it holds other snek objects. That is, it "references" them. They are contained in its x, y, and z fields.

When we create a vector and place objects in those fields, we need to increment the refcount of each of those objects! Otherwise, we might accidentally free its contents and be left with a vector holding garbage memory.

Assignment