In October of 1992 I wrote a Connect-4 algorithm in LISP for an artificial intelligence course at Dalhousie University. It was a big success, so in the Fall of 1993 I rewrote the algorithm in C. The algorithm, and the C code that implements it, is completely front-end independent, and fairly flexible. For example, multiple board sizes are supported, and it is also possible to specify the number of pieces necessary to connect in a row in order to win (it doesn't have to be 4). The computer can also play at a variety of skill levels.

To date, I have written three interfaces to the C algorithm. The first is a simple text-oriented interface that can be compiled and run on just about any machine. The second is a pretty nifty SGI interface that I wrote for a Computer Graphics course at The University of Waterloo. The third is an HTML interface (based on one initially written by Daniel Gordon) that allows a user to play the game over the World Wide Web. I've also written versions of the game for the Commodore 64 and VIC-20. All of this, and more, is available from this page. (Wow!!!)

Since the algorithm is so flexible, it's really easy to write several different front-end interfaces (with different looks and feels) for it on a variety of platforms. I encourage you to try writing your own interface.

Connect Four® is a trademark of Hasbro. I designed and implemented an algorithm to play the game, not the game concept itself. Hasbro has actually recently released a Connect Four CD-ROM game, which can be ordered through The CD-ROM Shop.


What would you like to see?

Related items on the Web:

<-- Back to my home page.