I have created a random hexagonal maze using an algorithm. But how do I limit the maze to just the green hexagonal region in the following picture? Note that the size of the maze and the green region can vary. Thanks!

I have created a random hexagonal maze using an algorithm. But how do I limit the maze to just the green hexagonal region in the following picture? Note that the size of the maze and the green region can vary. Thanks!

This works for even hexagons, but shouldn't be that difficult to adapt for odd hexagons.
You don't really need the
if (cne>0)bit in makeHexagon().