7.1.0.2

9 — Implementing the Referee

Due Monday, October 22, midnight

Code Base As of Wednesday noon latest, your repository will come with a new code base. All changes to your repo before this deadline may be wiped out.

Reviews The subsequent code reviews will start from a review of the git commit messages. So don’t even think about restoring your old code base .

Delivery For this assignment, you will still place the design documents into the Design/ folder and Santorini-specific code into the appropriate Santorini/ sub-directory.

Design Task While you are about to finish the first prototype of your gaming framework, you will not be able to show your manager anything about the game’s progress.

Design an interface for plugging observers into the referee component (see below). Start with a purpose statement and then spell out the wish list for your observer component. ~~ Do not implement one yet.

Implementation Task You have almost all the ingredients to demonstrate a complete prototype to your manager.

Implement your player interface. Your player should rely on your strategy to make decisions concerning the placement of initial workers and the actions to be taken when it is the player’s turn.

Implement a referee component that can supervise the interaction of two players. The referee component must be able to run
  1. one complete Santorini game between two players, and

  2. a "best of n" games series (for some natural number n).

Both methods should return the outcome of the game.

While you are the designer and implementor of both components and your goal is to run complete games, it is also time to consider interactions with "foreign-produced" components. Specifically, imagine developers who implement players to your interface. As the company’s plan says (see Resources), we could use our framework to run competitions among players built by hackers who have nothing else to do. What could go wrong? A player may break a rule. In that case, the referee terminates the (series of) game(s) and declares the other player the winner of the interaction. A player may also take too long to complete an action or, worse, go into an infinite loop. The referee may also wish to terminate the game in this case (and declares the other player the winner). Are there other scenarios that the referee component should be prepared for?

Testing Task There is no testing task this time.