Giter Site home page Giter Site logo

samuelemusiani / project_37635 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 339 KB

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

License: GNU General Public License v3.0

Java 91.41% Shell 0.30% TeX 8.29%
connect4 connect4-ai-game connect4-game heuristics java pvs

project_37635's Introduction

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.

project_37635's People

Contributors

samuelemusiani avatar

Stargazers

 avatar

Watchers

 avatar

project_37635's Issues

Aperture table

An aperture table is probably a good idea, especially in large board where we lost a lot of time searching for a move. The problem is that I don't now how to generate one or in general how to implement it.

Zobrist has slowed everithing

Before Zobrist on the board 6 7 4 we could reach depth 16 on the first move. I'm referring to the commit caccfe0.
After Zobrist (7303aac) we reach a depth 10 on the first move. Something wrong

Euristica

Serve una euristica veloce ma che abbia un senso

Lighter heuristic on small board

Nella tabella 4 6 4 gpt4reorder2 non vede abbastanza avanti per vincere come secondo giocatore. L9 però funziona, quindi ha senso alleggerire l'euristica per andare più avanti nella ricerca.

Forse la bitboard velocizza tutto :)

Report

In the end we need to write a small report on the project

HashMap vs Array

  • Investigate while the HashMap hits are so low (20 - 100 top).
  • Understand why with an array instead of the library HashMap the search is slower

License

Do we want to put a license on the project. If yes we need to verify that the code provided by the prof can be shared

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.