Assignment 7 – Santorini: implementing a remote player
1 Build and test

Assignment 7 – Santorini: implementing a remote player

.

Due Wednesday 11/14 11:59pm

1 Build and test

Implement a remote version of your Santorini player from assignment 6. Your player should read JSON input from a TCP/IP port. The player should be able to handle JSON messages of the form:

["Register"]

or

["Place",Color,Initial-Board]

or

["Play",Board]

or

["Game Over",Name]

where

all other data is as described in assignment 6.

When your component consumes:

A ["Register"], it should reply with a JSON string denoting a name for the player.

A ["Place",Color,Initial-Board], it should reply with a JSON list that contains two pairs of numbers, each between 0 and 4. The pairs correspond to placement positions for the workers 1 and 2 of the player in that order.

A ["Play",Board], it should reply with a JSON value of the form [Worker,Directions]. The value should correspond to a play that the player wants to execute.

A ["Game Over",Name], it should reply with the JSON string "OK".

The replies of your remote player should be consistent with the strategy described in assignment 6 given a look-ahead value n that the player retrieves through a configuration file.

After you implement the remote player, wrap it in a proxy player and reuse the test harness from assignment 6 with small modifications to test your remote player. Same as for assignment 6, given a ["Play",Board] input, the test harness should output a list with all the plays that do not allow the other player to win the game in n turns.

In contrast to assignment 6, your player shouldn’t assume that it will be given input as described by the above nor that it will receive messages in a particular order. If the messages do not match the above description or their order does not match that of a Santorini game (a "Register" followed by a "Place" followed by zero or more "Play"s followed by a "Game Over"), it should return the string "Santorini is broken! Too many tourists in such a small place...".

Deliverables: In your team’s GitHub repository, create a directory "Deliverables/7/7.1/" and deposit there your executable called “remote-player-test-harness”. No need to deposit any tests for valid interractions this time. We will try out the player on the valid tests from assignment 5 and assignment 6. However, please submit five input/output files for invalid interraction for a player with n = 1.