At my internship at CR games the first small project they set me on was to create connect4 in their proprietary engine. My programming abaility was then gauged depending on how long it took for me to complete.
The features in the required in the game were:
For the ai in the game, I wrote a version of the MiniMax algorithim, commonly used for two player board games. It used recursion to perform a depth-first search down each possible move and returned a positive score when it found a move that won it the game and negative score when it found a move that lost it the game. This ai was able to make it’s own four in a row, block players and predict forks.
One of the requirements was to have four games be playable at once, however since the ai regularly took quite some time to make a move players couldn’t do anything on any game when this was happening. So each game was put on a seperate thread. This allowed players to perform their moves on one game whilst the ai did their’s on another.