3D Tic Tac Toe
Artificial Intelligence, is definitely one of my interests. Sure, it will take over the world one day, but it’s so much fun to play with.
My introduction to artificial intelligence was at a university course on Data Structures and Algorithms. Our project was to write a 3d tic-tac-toe playing program—ok, that seems kind of difficult—but there was a twist, we had to have the computer act as the oponent—oi, wow!. That was the utterly perplexing part. How do you have the computer act as the opponent? That got me hooked on the problem and on the subject.
Here is my C implementation of a 3d tic-tac-toe playing algorithm on GitHub at TicTacTocToeEngine. The code is made to compile on any unix system, with the included make file.
The algorithm uses a board evaluation function and a simple search algorithm to find the “best” move for any given board position. This type of algorithm is a primer for computer opponents in turn based strategy games like checkers, chess and many others.
Here is a sample of an App that might use this type of algorithm.
iTicTacTocToe an iOS App
iTicTacTocToe uses code from the previously mentioned GitHub repository as the engine at the heart of it’s BRAIN!