The source is here.
Try with SWI-Prolog:
pl -s conn4.pl
?- play.
Example outputs:
conn4_1.txt,
conn4_2.txt
Ties between equally good moves are broken randomly, thus games
typically differ from run to run.
If you have a PostScript viewer (like "gs") installed, you can
also use a graphical and interactive version, with:
?- show.
At any turn, you can either press SPACE to let the computer choose
a move, or press one of the numbers 1, 2, ..., 7 to drop a piece
in that column.
Sample states of a game:
Main page