A server for the game Noughts and Crosses
About the game
In this game two players place markers (O:s and X:s) in the squares of
a board. The winner is the player that first gets five markers in a
About the server
I have installed a Noughts and Crosses server on dogbert, port 30831.
You can test it by doing
and use it in a fudget program by connecting to it with
telnet dogbert 30831
as I mentioned in the lecture on Fudgets.
The messages sent to and from the server all consist of one line of
The two players are called 0 and 1. Examples of commands you can send
Usually, the response to a command looks similar to the command. If
winning move is made, the response starts with the letter
init 20 20
- creates an empty bord of size 20x20 squares. The response from the
init 20 20
h 0 10 15
- tell the server that the human user makes a move for
player 0 by marking square (10,15).
- ask the computer to make a move for player 1.
The response is, for example
c 1 10 14
- close the connection
w instead of
If an error occurs, the response is the letter
e followed by an
error message. The server may also output a copyright message starting
with the letter
The server was implemented by Claes Löfqvist. See
also his web page on
Noughts and Crosses for
28 Jun 1999 16:30