Red Blob Games is pretty incredible... this in particular is one of my favorites, a description of how to write code for traversing hexagons. (scroll down to get to the interactive parts)