Here a rather complete guide to the "theory" with a link to implementation guides for several programming languages, especially, close to LC, JavaScript. https://www.redblobgames.com/grids/hexagons/