Code Monkey home page Code Monkey logo

connect-four's Introduction

The code comments are helpful.

minimax implmented from:https://www.javatpoint.com/ai-alpha-beta-pruning heuristic/evaluation function: https://stackoverflow.com/questions/10985000/how-should-i-design-a-good-evaluation-function-for-connect-4

The struct is made for minimax to return two values. The score and the col for which that score is obtained. The minimax function works on score but we need col also so we keeo track of that in the struct.

The scoring idea is taken from internet and I have provided link for that. Basically I'm looking the whole board and making the arry of 4 stones. After that I'm checking those stones, e.g Can I make the 4 stones in this state? Or Can the opponent make the 4 stones in this state. Checking these types of few things and score it accordingly.

More abstract code: https://github.com/crackaf/connect4

connect-four's People

Contributors

hunzlahmalik 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.