How do I color a hexagonal grid such that it doesn’t have neighbors of the same color?
In a hex grid you’ll need three colors to color each hex so that it doesn’t have the same color as a neighbor: You were on the right track with your solution. Instead of adding x+y you’ll want to subtract x-y. The other change is that &3 is for bit manipulation; you’ll want %3 instead. … Read more