Trav's Tic-Tac-Toe Trainer
1. Introduction
The idea behind Trav's Tic-Tac-Toe Trainer (TTT) had been bubbling around in my head for a couple years.
I finally had an opportunity to work on it in grad school, for CS661 (Algorithms).
I finished the first part (teaching a neural network how to play Tic-Tac-Toe),
but didn't have time for the second, less well-defined part (getting neural networks to invent and evaluate Tic-Tac-Toe variants).
- ttt.doc
- This Word doc is my final presentation for CS661 (Algorithms). 1998-05-06
- ttt.zip
- This is a ZIP of all the files listed on this page.
2. Source Code
I wrote everything in C++. I think I developed on my PC and then uploaded and tested on the university's UNIX servers.
2.1 C++ Interfaces:
- common.h
- Defines common constants and macros.
- board.h
- Interface for the Board class. A Board can be a game board, a winning configuration matrix, or a "scratch" board that Players can use in planning their turns. (TradPlayer uses one.)
- debug.h
- Interface for Debug class. This helps me debug my other classes.
- game.h
- Interface for the Game class. This determines and maintains all the rules, players, game statistics, etc.
- hplayer.h
- Interface for the HumanPlayer class. This provides a game playing interface for a real-life person. Humans have their own turn-taking strategies, names, and sources of feedback.
- neunet.h
- Interface for the NeuNet class. This is a neural network architecture that is used by the NeuralPlayer.
- nn_arch.h
- Interface for the Arch class. Used by the NeuNet class.
- nn_layer.h
- Interface for the Layer class. Used by the NeuNet class.
- nn_link.h
- Interface for the Link class. Used by the NeuNet class.
- nn_node.h
- Interface for the Node class. Used by the NeuNet class.
- nplayer.h
- Interface for the NeuralPlayer class. This is a Player whose decisions are dictated by a Neural Network, thus providing a "bottom up" approach to AI.
- player.h
- Interface for the Player class. Also includes macros related to it. A Player is any participant in the game. The Referee is also a Player (players[0] to be precise).
- referee.h
- Interface for the Referee class. The Referee is a participant just like the other Players, but has more power and responsibility. Its job is to keep the game moving by prompting the players to take their turns, making sure the players adhere to the rules, and informing the players about how well they are performing. You can think of the Referee as the friendly liaison between the game rules and the game players.
- school.h
- Interface for the School class. This represents the "game world".
- tplayer.h
- Interface for the TradPlayer class. A TradPlayer is a "top-down" or "traditional AI" player. It is used to train the NeuralPlayer.
2.2 C++ Implementations:
- board.cc
- Implements the Board class.
- debug.cc
- Implements the Debug class.
- game.cc
- Implements the Game class.
- hplayer.cc
- Implements the HumanPlayer class.
- neunet.cc
- Implements the NeuNet class.
- nn_arch.cc
- Implements the Arch class.
- nn_layer.cc
- Implements the Layer class.
- nn_link.cc
- Implements the Link class.
- nn_node.cc
- Implements the Node class.
- nplayer.cc
- Implements the NeuralPlayer class.
- player.cc
- Implements the Player class.
- referee.cc
- Implements the Referee class.
- school.cc
- Implements the School class.
- tplayer.cc
- Implements the TradPlayer class.
- ttt.cc
- Main program.
2.3 Makefiles:
- Makefile
- This builds the object files and executables. It also backs up the important files and runs the program.
2.4 Shell Scripts:
-
cont
cont2
cont3
cont4
- These run ttt several times, using different parameters.
-
exam
make_pla
- I don't remember what these do.
-
h
h.save
- These run ttt once.
4. Binaries
These were built several years ago on a server which is currently running SunOS 5.9. I think they still work. You will probably have to right click to download.
- ttt
- This is the main executable.
- ttt_nla
- I forget what "NLA" means.
- ttt_old
- I think this is an old version of ttt. I forget why I kept it around.