FR: Iterate over rings and ranges of size N around arbitrary coordinates

did:plc:zviscnpwyvj6y32agi5davn5 opened this 18d ago 1 comments
did:plc:zviscnpwyvj6y32agi5davn5 opened 18d ago

These should be available as:

  • const HexCoord::ring(&self, distance: usize) -> Iter<HexCoord>
  • const HexCoord::range(&self, distance: usize) -> Iter<HexCoord>

We should be able to structure range() as a concatenated result of something like (0..=distance).map(|n| self.ring(n)). As for ring(), we should be able to plot out the coordinates at the corners of the ring shape, then walk between them.

No activity yet.

cospan · schematic version control on atproto built on AT Protocol