Parallel Connect Four Java Application

1. Description

Parallel Connect Four is a Java Program that implements a simple Connect Four strategy that is parallelizable.  The program was written to illustrate how Java programs can be written to communicate via sockets to accomplish a parallel task.  Each player can be either a human player, a computer player, or a networked-computer player.  In the event of networked computer players, you must start "Thinker" processes that will actually do the thinking, and uplink them to the game.  Note that the goal of this project is not to create an unstoppable AI (there are much better Connect Four players out there than this program).  It is merely to illustrate a sample implementation of a parallel algorithm in Java.  See Usage Instructions for more details.

For educational purposes only, I've decided to make the source code publicly available.

2. Screen Shot

3. Disclaimer

THE PARALLEL CONNECT FOUR JAVA APPLICATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  MARK ROTH DISCLAIMS ALL WARRANTIES, EITHER EXPRESSED OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL MARK ROTH BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MARK ROTH HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.  SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

4. Usage Instructions

4.1. System Requirements

To use the Parallel Connect Four Java Application, you must have the following:

4.2. Download and Installation Instructions

To download the system, click on the following link, and uncompress the zip file to any directory.  Then, add this directory to your CLASSPATH:

4.3. Compilation Instructions

To compile the system, use JDK 1.1.6 or above and type make.  If you don't have a make utility, manually execute the following command:

    javac edu/rit/cs/mlr5773/connectfour/*.java

4.4. Single-Computer Execution Instructions

To execute, add to your CLASSPATH the directory you extracted the files to (remember that the CLASSPATH is separated by colons ':' on UNIX systems and by semi-colons ';' on Windows systems), and type:

    java edu.rit.cs.mlr5773.connectfour.ConnectFour <x> <y> <z>

Where:

4.5. Execution Notes

A Search depth of 4 will take approximately 20 seconds per move on a 166 Mhz Pentium processor.

You must execute this program on a system that is GUI-capable (i.e. under UNIX, the system must have a DISPLAY).

4.6. Parallel Execution Instructions

To run this program in parallel, follow these instructions:
 
  1. Load Connect Four, as shown in section 4.4.  Specify one or more players as a 't' (Thinker).
  2. You will be prompted by a dialog showing the currently registered thinkers.
  3. Load a Thinker on each processor you want to contribute to the processing pool.  See below for how to load a Thinker.  Loading more than 7 thinkers will result in processors 8 onwards to never be utilized.
  4. When all desired thinkers appear in the listbox, click OK
  5. Play game normally.
To load a Thinker on any SPARC:
  1. Make sure your CLASSPATH is set up as described above.
  2. Make sure ConnectFour is running and the dialog is displayed.
  3. Type: 


  4.     java edu.rit.cs.mlr5773.connectfour.Thinker <host> <port>


    Where <host> is the name of the system you ran ConnectFour on and <port> is 2005.
To load a Thinker on the Sun 450 SMP:
  1. Log on to parasite (or paradise).
  2. Make sure your CLASSPATH is set up as described above.
  3. Type:

       tmrun -np 7 java edu.rit.cs.mlr5773.connectfour.Thinker <host> <port>

    Where <host> is the name of the system you ran ConnectFour on and <port> is 2005.

4.7. Closing Down the Game

You cannot restart the game.  You must shut down and reload it.  To shut down the game and thinkers gracefully, simply close the ConnectFour window.

5. Final Notes

This program was created by Mark Roth, a student at the Rochester Institute of Technology in Rochester, NY.  If you have any questions, comments, suggestions, or bug reports, please do not hesitate to contact me.  My contact information is as follows:

        Mark Roth
        Rochester Institute of Technology
        E-mail: markroth8@yahoo.com



Last Updated: December 6, 1998