https://github.com/samuelemusiani/project_37635
A program made to play a generalized version of connect 4 perfectly
https://github.com/samuelemusiani/project_37635
connect4 connect4-ai-game connect4-game heuristics java pvs
Last synced: about 1 month ago
JSON representation
A program made to play a generalized version of connect 4 perfectly
- Host: GitHub
- URL: https://github.com/samuelemusiani/project_37635
- Owner: samuelemusiani
- License: gpl-3.0
- Created: 2023-06-23T16:18:46.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-03T22:03:02.000Z (about 2 years ago)
- Last Synced: 2025-08-27T12:13:26.895Z (about 1 month ago)
- Topics: connect4, connect4-ai-game, connect4-game, heuristics, java, pvs
- Language: Java
- Homepage:
- Size: 331 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:
```sh
$ ./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:
```sh
$ 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:
```sh
$ 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.
```sh
./full_test.sh L0 L1
```
If you want the verbose output just use the `-v` flag.