ring

fun ring(originQ: Int = 0, originR: Int = 0, radius: Int, callback: (Int, Int) -> Unit)(source)

Calls the provided callback on each point forming a ring in a hexagonal grid defined by provided origin and radius.

Parameters

originQ

The 'q' coordinate of the origin point. Default is 0.

originR

The 'r' coordinate of the origin point. Default is 0.

radius

The radius of the ring to loop over.

callback

A function to call on each point along the ring.