Giter VIP home page Giter VIP logo

sachinbrraj / connect-k-ai-engine Goto Github PK

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

An advanced AI engine for Connect-K game which follows all the rules of the game similar to Connect-4 with additional features. Implemented Min-Max algorithm (gamestrategy) with alpha-beta pruning algorithm, iterative deepening search in order to achieve a depth of 7 within 5 seconds. The agent was ranked among top 10% of all the AI designed during the course.

Java 56.53% Python 26.64% Shell 0.57% C++ 16.12% Batchfile 0.14%

connect-k-ai-engine's Introduction

An advanced AI engine for Connect-K game which follows all the rules of the game similar to Connect-4 with additional features. Implemented Min-Max algorithm (gamestrategy) with alpha-beta pruning algorithm, iterative deepening search in order to achieve a depth of 7 within 5 seconds. The agent was ranked among top 10% of all the AI designed during the course.

Steps to build and run :

ConnectK.cpp has main function to get a current state from the java shell. AI agent is implemented in AIShell::makeMove(). AIShell::gameState has the current game state as array of integers. 0, 1 and -1 represent empty, AI piece and human piece respectively.

Then compile your code and make an executable file (for example on Windows, myAI.exe). On Linux, open a terminal and type

g++ ConnectK.cpp Move.cpp AIShell.cpp -o myAI

Then you can test your AI agent by running ConnectK.jar with the following command.

On Windows: java -jar ConnectK.jar cpp:myAI.exe

On Linux: java -jar ConnectK.jar cpp:myAI

connect-k-ai-engine's People

Contributors

ddevanir avatar sachinbrraj avatar

Watchers

 avatar

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.