line
Generates a line of points between two given points in a hexagonal grid. The line is generated by calculating the distance between the start and end points, and then interpolating the coordinates for each step along the line. The provided process function is called for each point along the line.
Parameters
start Q
The 'q' coordinate of the start point.
start R
The 'r' coordinate of the start point.
end Q
The 'q' coordinate of the end point.
end R
The 'r' coordinate of the end point.
process
A function that's called for each point on the line.
Generates a line of coordinates from this coordinate to another.
Return
A list of coordinates marking a path between the two points.
Parameters
other
The destination coordinate.