Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

samuelemusiani/project_37635

Open more actions menu

Repository files navigation

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:

  • With -v the output will be verbose
  • With -t you can specify a maximum time of each move
  • With -r you can specify how many rounds need to be played.

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.

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.