/* * Fitchneal server v 0.1 * 9/22/06 Kenrick Mock * If you find any errors send them to kenrick@uaa.alaska.edu * * You are also welcome to use the source code and extend this program * any way you see fit. Maybe you'd like to add mouse input for * the human player? If you make a significant contribution please * send it to me and I'll post it for all to use. * * This program implements a server to play the game of Fitchneal. * The rules it uses are: * * Defender wins if king reaches the edge * King captured if surrounded on all sides by attackers, * or surrounded on three sides by attackers and the throne * King cannot be used to capture attacker's pieces * The king is the only piece that can land on the throne * All pieces can move over the throne * * If network play is selected then the network player should * connect to the IP of this machine on port 8112. * The first network player to connect will be the attacker * and the second the defender. The server will send back a * String of "attacker" or "defender" to tell the client which * player it is. A simple way to test the network interface is * to simply telnet to the server, e.g. from a command line: * telnet 137.229.156.33 8112 * and then type moves into the telnet window. * * Network clients send moves in the form X1 Y1 X2 Y2 * followed by a newline or carriage return. The server will send the opponent's * move to the client in the same format, but followed by a carriage return * and line feed. * * It is the responsibility of the client to ensure that it makes only * valid moves and to keep track of the board state itself. Any invalid * move by a network client results in immediate disqualification. * */