

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Garbage Collector
incomplete
2: Refcounting
incomplete
3: Increment
incomplete
4: Decrement and free
incomplete
5: Vectors
incomplete
6: Arrays
incomplete
7: Refcounting Review
incomplete
This lesson's interactive features are locked, please to keep using them
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.