How to Write an HQ Contestant Program
1.0 Getting HQ
- Set the JAVA_PATH environment variable to the JDK1.1 directory.
- Set the HQ_HOME environment variable to your hq directory.
- Download the HQ source into
the HQ_HOME directory.
- Unjar the file.
- Change directories to $HQ_HOME/sources/org/gherrity/hq.
- Type 'make' to compile the code, 'make applets' to make the HQ applet, and
'make docs' to create the javadocs.
2.0 Running HQ
Make sure HQ_HOME is in your CLASSPATH.
- To run the HQ application enter 'java org.gherrity.hq.gui.Main'.
- The HQ applet is in the $HQ_HOME/applets directory.
3.0 Testing A Contestant Program with Your Version of HQ
- Modify the org/gherrity/hq/gui/Contestant.java file as follows.
- Add the name of the contestant to the String contestantName. This
is the name that will be seen in the pulldown window to select a
contestant.
- Increment the CONTESTANTS constant.
- Construct the new static Contestant object.
- Add this object to the contestant array.
- Add a case for constructing the new contestant object in the
create method.
Refer to the other contestants in the Contestant.java file for details.
- Recompile HQ from the org/gherrity/hq directory by typing 'make'.
4.0 The HQ API
A contestant program that simply passes every turn is provided in the
org/gherrity/hq/passer directory. A slightly more complex program that
simply moves towards the other player's HQ is provided in the
org/gherrity/hq/rusher directory. Note that only a constructor and a
single makeMove method are required. Further details are provided in
the javadocs.
5.0 Adding A Contestant Program to HQ
To enter your contestant program into HQ, have it be rated using the regular
matches and tournaments, and have it be downloaded by others, mail your code
to gherrity@san.rr.com.