P and Q will not exceed 128. An illegal move invalidates a solution set and is scored as zero points. An illegal move occurs when a MEV is moved over rough terrain or outside the grid. The two players of the game are your program and the evaluation library. Your program always has the first move.
Players alternately place hex counters on the board.
A hex counter may be placed at any open position on the board. Two hexagons are adjacent if they share an edge. You are required to write a program which plays the game of Hex. If your program plays optimally, it will always win. Your program must not read from or write to any files.