Self-Learing Tic Tac Toe

  • This TicTacToe game stores every game played to a text file. These games are stored as strings of 11 characters, with the first 9 characters representing the position and order of moves played and the last two communicating if a win/loss ("nn") or a tie ("TT") has occurred. For example,


    In this case, the first move was played at index 4, then at 1, then at 2, and so on. The fact that the game ends with less than 9 moves and ends with "nn" means that it has not ended in a tie. Here are some more examples,


    The computer scans these games for information that could improve its next move. Finding similarities can lead the computer towards a win, or help avoid a loss. After enough unique games, the computer will never lose.
  • Andrew Stekar


    University of Waterloo