

The constraint is that q + r + s = 0 so the algorithms must preserve that. The cube coordinates are a reasonable choice for a hex grid coordinate system. We'll use this property in the neighbors section.

For example, northwest on the hex grid lies between the +s and -r, so every step northwest involves adding 1 to s and subtracting 1 from r.

