coxmediagroup/Tic-Tac-Toe — pull request #111 by nloadholtes (2013-08-22 16:01:53+00:00)
Title: Hi, here's my take on the tic-tac-toe problem

When looking at this problem it occurred to me that "scoring" the cells could be a good strategy for determining the next move. As I was debugging the program (on the "winningPlayer" branch) I did some research and saw a lot of people like to use the minimax algorithm to exhaustively search the game tree for a winning solution.

Once I saw that my scoring approach worked (granted it did require a little bit of hand-tuning to get the heuristics right) I decided to stick with it. The game does not seem to loose, but it will play to a draw. Additionally I've included a randomPlayer() function just to demo another approach.

I've run coverage over the 2 main files (tictactoe.py and ai.py) and I show there is 91% coverage from the tests.

Please let me know if there's any questions. Thanks for you time!

-Nick