Skip to main content

Module hex

Module hex 

Source

Functions§

hex_distance
Returns the hex distance between two axial coordinates. Calculated as max(|dq|, |dr|, |dq + dr|).
hex_offsets
Returns all (dq, dr) offsets within hex-distance ≤ radius of the origin. Used for legal move generation and cache updates.