The Interfacesuperply.jar - this is the server. It now comes with source!
java -jar superply.jar HOST PORT MODE TIME
Algebra Game Board
HINT ConstraintsThese will be the only hints available in the game. The deterministic game will issue the hints in exactly this order, repeating the entire sequence once the end is reached and skipping over hints that do not correspond to the value in any unclaimed cell to the next hit that does. In the random case, they will be issued in an even distribution ignoring invalid hints. The hints are:
HINT between 0 18
HINT between 18 81
HINT contains 4
HINT between 0 16
HINT between 16 36
HINT contains 2
HINT between 12 42
HINT between 20 54
HINT contains 5
HINT between 8 20
HINT between 18 30
HINT contains 1
Connect to the server as we have done before by sending it your player name on a single line. As with before spaces are allowed, but line breaks are not.
When the game begins, you will receive the message
INIT board_size (deterministic, random)board_size is a number indicating the width and height of the game and the word deterministic or random will indicate how the hints will be chosen.
You will then see
X num1 num2 ... numboard_size followed by
Y num1 num2 ... numboard_size These indicate the values across the top and side respectively. You are left to calculate the value at each cell of the grid.
You will frequently be updated on the status of the game with this message:
STATUS name1 r c r c r c ... , name2 r c ... where name1 is the first player's name, name2 is the second player's name, each r followed by a c is a zero indexed row column pair in which he has successfully played. You can look here to discover if you are first or second player, depending on where your name occurs. First player will try to make a connection from left to right, while second player will be trying to make a connection from top to bottom.
When it is your turn to move you will receive a constraint message. You will always receive a status message directly before a constraint message. The constraint message is of the following form:
HINT odd only odd valued cells are valid moves
only even valued cells are valid moves
only cells valued between num1 and num2 inclusive are valid moves. You will see this often because greater than and less than constraints are issued with this message. Please note that num1 and num2 may be values that do not occur on the board or even within the range of possible values on the board.
HINT between num1 num2
only cells whose value contains num1 in their decimal representation are valid.
HINT contains num1
You will respond in the following way:
r c where r and c is a zero indexed row column pair separated by a space. Valid moves are only those cells whose value satisfies your hint constraint and within [0 .. board_size -1] where brackets means inclusive.
YOU WILL NOT BE NOTIFIED directly whether your move succeeds or fails. You must check for this the next time a STATUS message is sent to you.
The following command may be sent at any time
WARNING milliseconds this indicates that you only have milliseconds time remaining in your aggregate turn clock.
If you do not send a move within milliseconds time you will be issued the message
TIMEOUT and your opponent will be declared the victor.
When the game ends you will receive one of the following messages depending on how clever you were:
After receiving one of these your socket will the disconnected.