/****************************************************************************/
/****************************************************************************/
/**                                                                        **/
/**                          Connect-4 Algorithm                           **/
/**                                                                        **/
/**                            By Keith Pomakis                            **/
/**                     (kppomaki@jeeves.uwaterloo.ca)                     **/
/**                                                                        **/
/**                               Fall, 1993                               **/
/**                                                                        **/
/****************************************************************************/
/****************************************************************************/

The files "c4.c" and "c4.h" provide the functions necessary to implement a
front-end-independent, device-independent Connect-4 game.  Multiple board
sizes are supported.  It is also possible to specify the number of pieces
necessary to connect in a row in order to win.  Therefore one can play
Connect-3, Connect-5, etc.  An efficient tree-searching algorithm (making
use of alpha-beta cutoff decisions) has been implemented to insure that the
computer plays as quickly as possible.

The file "game.c" is also being distributed, which illustrates how the
Connect-4 functions can be used to construct an implementation of an actual
game.  This file was quickly written just to get an actual implementation up
and running; it is NOT the reason for this distribution.  The idea is for
people to create their own front-ends for this algorithm.  The functions
have been designed to be general enough to be used with any front-end one
wishes to design.

The documentation describing each function can be found in the source code
itself, "c4.c".  I believe the comments in this file are clear and
explanatory enough not to warrant an external documentation file.  The
sample front-end, "game.c", contains no documentation (hey, I've got other
work to do, you know!).


History
-------

I developed this particular algorithm back in October 1992 for an
Artificial Intelligence assignment.  At the time, I implemented it in LISP.
One year later I decided to convert the algorithm to C code so that I could
use it as the smarts of a graphical front-end to the game.  In performing
the conversion, I took care to make the code as general as possible.

The graphical front-end that I developed is not being distributed, partly
because it's a heck of a lot of code, and partly because I doubt many people
would have access to the SGI hardware necessary to run it.


The Algorithm Itself
--------------------

I've never actually WRITTEN the algorithm down anywhere, apart from the
actual source code itself.  Nevertheless, it's a pretty nifty algorithm that
I'd be happy to explain to anybody who's interested.


Legal Stuff, etc.
-----------------

I am releasing these functions to the public domain.  Therefore, people can
use them, copy them, distribute them, modify them, and do whatever they
want with them.

If you find any bugs (gasp!) or have any questions or comments about the
functions or about the algorithm itself, you can contact me via e-mail.  My
address is "kppomaki@jeeves.uwaterloo.ca".  I'd be interested in hearing
what you think!

Oh, one other thing... I've put a lot of work into these functions, so I'd
appreciate it if you kept my name attached to them when distributing or
modifying them.  If you actually these functions for anything, give me
credit somewhere!

