Superply is a game to help kids learn math or other subject matters. To see how it works, consider the multiplication table. So you have 1 through 9 along the top and 1 through 9 along the left side. Initially, the interior squares are blank. You then get hints. For example, "the product is less than 30" or "the product contains a 7". Many of the product cells correspond to the hint. The issue is which one to choose.
The goal of the blue player is to build a blue path across the grid (from the leftmost column to the rightmost) where a blue path consists of a sequence blue squares such that the first one is in the left column, the last is in the right column and each square touches the next one in the sequence on a side or on a corner. The goal of the red player is to build a red path from top to bottom.
To claim a square, the blue player must choose one that satisfies the hint he/she gets and that is not already occupied. Similarly for the red player.
At any point, the state of the game is the set of squares colored blue and the set colored red. The hint can be abstracted as the set of squares satisfying the hint.
Play alternates between players.
You will play the multiplication game competitively.
You will receive hints of the following kind:
The product is odd.
The product is even.
The product is between X and Y, inclusive.
The product contains an X.
The product is less than X. You must then choose a square that satisfies the hint and is not already occupied. In the deterministic version, play proceeds sequentially through the hint sets and then repeats. In the randomized version, each hint set is chosen randomly and uniformly. Blue moves first.
Your goal is to win the game.
You will build a java applet that will communicate across some port to superply, so you can allow program-to-program play as well as program-to-human play. You will send a start command, display the result and send the parsed hint to the two sides. You will also maintain a history of previous requests that can be sent to either player. You will also declare the winner when a connected path of the proper orientation (left-right for blue and top-bottom for red) has been formed.
Here is the game based on a K interface.