zachmokahn/TicZacToe — pull request #22 by zachmokahn (2013-12-10 21:59:00+00:00)
Title: update computer to utilize board class

I separated the board into its own class to separate the dependency of the
game on the computer.

The computer works its own logic, but capitalizes on some methods
avialable to it through the board class
* #checkSpot
* #getSpaces
* It also uses the constants of the board to shorten some logic

Initialy the board was an array inside of the game class, and the game
was heavily dependent on the computer class. The computer would work out
results to the game, and the game would either utilize functions
available to the computer class, or I would rewrite very similar methods
inside of the game class to preform similar functions. In retrospect
that was not very DRY, so I am going through and cleaning it up.

I spent all of one day trying to separate the game, the board, and the
computer class entirely on paper and how logically it would make sense.
I came to the conclusion that the computer is always going to be
dependent on the board, without a board the AI feature would have
nothing to preform it's methods. I did come to the realization that the
game should not have to depend on the computer. This separation of the
board from the game (which essentially break down to the rules of the
game) and the computer from the game (which essentially breaks down to
another player in the game) the game could easily interchange another
human player for the computer, or even play two computers agianst each
other, and the game should still run as smooth.