title: Finding adjacent neighbors on a hexagonal grid
body: <p>EDIT: Wrapped the example map in a code block so the formatting is correct.</p>
  
  <p>Ok, I'm trying to write an extremely simple A* algorithm over a hexagonal grid. I understand, and can do the A* portion. In fact, my A* works for square grids. What I can't wrap my brain around is finding neighbors with hexagons. Here's the layout for the heagonal grid</p>
  
  <pre><code>0101     0301
      0201      0401
  0102     0302
      0202      0402
  </code></pre>
  
  <p>etc, etc</p>
  
  <p>So, what I need help with is writing a Hexagon class that, given it's hex coordinates, can generate a list of neighbors. It needs to be able to generate neighbors which would 'fall off' the grid (like 0000 or 2101 in a 20x20 grid) because that's how my A* tracks across multiple maps laid side-by-side. So something that would work with this code snippet:</p>
  
  <p>planet = Hex('0214')
  print(planet.neighbors())
  ['Hex 0213', 'Hex 0215', 'Hex 0115', 'Hex 0315', 'Hex 0116', 'Hex 0316']</p>