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,

     4126508nnnn

    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,

     04217385nnn
     043172856nn
     420173658nn
     014826357TT
     402613nnnnn
     047123568nn

    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

     AndrewStekar

    University of Waterloo

      atstekar@uwaterloo.ca