Jacques Frechet's CS20c Project Plan:Four-Dimensional Tic-Tac-Toe |
|
My goal is to create a complete Four-Dimensional Tic-Tac-Toe Playing Environment. Players will access the game server by pointing their favorite Java-enabled Web browser at a particular URL. After signing on, the Java client will display a window containing lists of games in progress and other players, including at least one computer player, as well as statistics about each game and each player. Clicking on a list item will open a new window which will either show a game in progress or a list of options for challenging another player to a game. Since each game will take place in its own window, it should be relatively simple to observe or participate in several games at once.
The player might be allowed to specify any of the following:
When playing against the machine, some additional options might come in handy:
Or, for those who lack the inclination to tinker with such options, there could be presets:
The server will consist of a single, self-contained executable written in C++. For ease of installation, all necessary data files (HTML pages, graphics, and the Java client) will be linked directly into the executable as static data. When called by a CGI-compliant HTTP daemon, the server will spit out the data appropriate to the URL which was requested. If executed by a user from the command line, the program will document itself.
Whenever a new player joins the server, the server will scan TCP ports on the local machine to determine whether or not an instance of itself is already handling incoming TCP connections from clients. If not, it will fork and bind to the first available port in the range. In either case, the original server will send an HTML page containing the Java client, with the correct port number included as a parameter to the applet. When all connections to the client-handling instance of the server have been closed, that instance will terminate. To ensure that this does not cause problems, with cached copies of the client attempting to reconnect to the server, the client will be sent with an HTTP response header indicating that it should not be cached.
When the client starts, it will attempt to open a TCP connection back to the host it came from on the specified port number. (Due to Java's security restrictions, applets are not allowed to open connections to any host except that which originated the applet.) This connection will remain open until the applet terminates. Ideally, all communication between a particular client and the server will take place over a single connection, even if the user opens multiple windows corresponding to several games.Some game-tree related references:
I also have some technical documentation on CGI and cookies which may be relevant to this project.
Be sure to take a look at this neato page on Toy and Game Design Guidelines, which includes an example on Various Executions of Tic-Tac-Toe. After all, what's a good concept without good marketing? Brought to you by Ayers Concepts, the "Toy Invention SuperSite."
As far as existing work goes, check out The Game of Toe, which looks to be a surprisingly similar project to this one in terms of implementation. The game implemented is just regular tic-tac-toe, though; for the 4-D aspect, without the network stuff, take a look at this project by Jacob Walker, which includes a link to Pascal source code and a DOS executable.
I've discovered two more existing 4-D tic-tac-toe games: one for DOS, and one for Mac.