After the humble success of my Slide PuzzleÂ I wanted to create a multiplayerÂ game, because games or more fun when you beat your friends right?
Inspired by the simplicity (read: not having the skill for any complexity) of a 3Ã—3 grid based game I thought to my self: Tic-Tac-Toe, a basic turn based two player game without animation requirements like for example Pong.
What makes you win Tic-Tac-Toe? Three in a horizontal, vertical or diagonal row for a total 8 possible win scenario’s. So basically something like:
if topLeft == P1Â and topCenter== P1Â and topRight == P1Â then win!
if centerLeft == P1Â and centerCenter== P1Â and centerRight == P1Â then win!
if bottomLeft == P1Â and bottomCenter== P1Â and bottomRight == P1Â then win!
As you can see, this starts to add up and still only shows horizontal win checking for player one, since there are two players that can win we have write 16 different possible win scenario’s.
The original was, just like the sliding puzzle, written in Visual Basic 6 and I can recall a massive module file with the AI purely written as if statements as my for loops didn’t quite work. *mumbles zero-based numbering*
So I’ve recreated my project with slightly less code that the original but still true to the original with a debug listview and all.