samuelemusiani / project_37635

A program made to play a generalized version of connect 4 perfectly
GNU General Public License v3.0
1 stars 0 forks source link
connect4 connect4-ai-game connect4-game heuristics java pvs

Connect X

A program made to play a generalized version of connect 4 perfectly

Commands

Compile

If you are on Linux or macOS you can simply run the following command in the project directory:

$ ./gradlew build

If you are so unlucky to work on Windows, the following command should work:

$ gradlew build

CXPlayerTester application:

After the project built successfully, you can test computer vs computer with the following command:

$ java -jar build/libs/connectx.jar 6 7 4 connectx.Players.L0 connectx.Players.L1  

If you are on Windows remember to change the / to the \ for the path.

There are additional flags to use in order to specify different configurations:

Verbose output and customized timeout (10 sec) and number of game repetitions (2 rounds) should look like this:

$ java -jar build/libs/connectx.jar 6 7 4 connectx.Players.L0 connectx.Players.L1 -v -t 10 -r 2

CXGame application:

In gradle.build the main class is specified, if you want another class to run as main (for example the CXGame) you can simply uncomment the commented line.

full_test script

There is a bash script with the name full_test.sh that allow to use the CXPlayerTester with all the board configurations stored in board_configurations.txt. The use is pretty simple: you just need to pass two player names in the command line and the script will do the rest.

./full_test.sh L0 L1

If you want the verbose output just use the -v flag.