The game is played on a hexagonal grid with pre-placed tiles and a predefined starting location. Each tile has 12 entrances numbered 0-11, forming 6 distinct path segments — each entrance is used exactly once. A single path segment is represented by two integers: entranceA and entranceB.
Example of a single tile with numbered entrances.
Gameplay:
- The path starts on the base tile at position [0, 0], at entrance 7.
- Each turn, the player may rotate the tile directly ahead by 0-5 counter-clockwise steps.
- After the rotation, the player follows the connected path.
- The path continues until it reaches a not-visited cell, a board edge, or returns to the base tile.
- The game ends when the path reaches the edge of the board or returns to the base tile.
Scoring:
Each turn consists of marking the tile as visited and following the resulting path. For every segment traversed during that turn, the player earns incremental points:
- If the path passes through 1 segment this turn, the score increases by 1
- If the path passes through 2 segments this turn, the score increases by 3 (1+2)
- If the path passes through 3 segments this turn, the score increases by 6 (1+2+3)
- If the path passes through 4 segments this turn, the score increases by 10 (1+2+3+4)
- If the path passes through 5 segments this turn, the score increases by 15 (1+2+3+4+5)
- and so on...
Coordinate system:
The board has a fixed size: all cells are located at most 3 units away from the center.
You will receive the initial configuration of each tile, including its position ([x, y]).
Below is the coordinate system used in this puzzle:
Coordinate system:
y increases towards the south
x increases towards the north-east
Your task:
Before each turn, you can rotate the tile directly ahead of the current path. You will also be given maximum allowed tile rotations for the game.
Your objective is to achieve the highest possible score for each given board configuration.
Good luck!