Algorithm to generate a hexagonal grid with coordinate system
问题 I am trying to roll up 19 lines of code into a single for loop, but I am feeling a bit stumped. The reason I ask, is because I want the grid to be other sizes instead of 5. In Main::drawHexGridAdvanced() , I am trying to deduce the similarities between each line as opposed to Main::drawHexGridBasic() where I am hard-coding values. I am not sure how to determine the start of the x for each column in each row, because the pattern for n == 5 is 0, -1 -2 -2 -2 after that each consecutive column