Project 1: Clock

There are 24 slots available in the game of Clock, two slots at each of the twelve hour positions on an old-fashioned clock. There are 24 letters (A through X) that are allocated evenly at random to three players and players don't see each others' letters. The letters will be placed in the slots one by one in turn during the game.

At the beginning of the game, each player is dealt a number C of constraint cards. A simple constraint might be D<B. This is satisfied in a game configuration if, counting clockwise from D's slot, one gets to B sooner than if one proceeded counterclockwise. In other words, B's slot must be within 5 clock positions counting clockwise from D's slot. A complex constraint might be D<B<F. This constraint is the conjunction of D<B and B<F. Note that < is not transitive, since it is possible for D<B and B<F to be true while D<F is false. More complex constraints can be formulated by chaining up to five letters, e.g., D<B<F<G<A.

Constraint cards have a constraint written on them, together with a payoff. The more complex the constraint, the higher the payoff. If at the end of the game, a constraint card is satisfied, the player earns the payoff. If not, the player loses 1 point. At the beginning of the game, the player (knowing the letters they have been dealt) can choose which of the C cards to keep, and which to discard. Discarded cards do not receive the payoff or the 1 point penalty. Players do not see other players' constraint cards, or know how many cards were kept. To minimize variation between players in a game, the first constraint card received will compare two letters, the second will compare three letters, the third will compare four letters, and and fourth will compare five letters. From this point on, the simulator will repeat this cycle, i.e., the fifth card received will compare two letters, etc. until C cards have been dealt. The letters in a constraint will be distinct, and chosen by the simulator at random, independent of letters held by a player. The simulator will have a random number seed for repeatability, so that you can run a game with the same letter and constraint card distributions multiple times during code development.

Payoffs are as follows:

You will write a player that interacts with the simulator to play this game. Each time your turn comes around, you will have access to the state of the game and will be expected to put a letter into an empty slot. Your final score will be calculated at the end of the game based on the total of the payoffs.

At the end of the project we'll run a set of tournaments for various values of C.

Some initial things to think about:

Ken Ross 2023-10-17