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.