Coder Social home page Coder Social logo

connectfour's Introduction

@Author: Abinashi Singh
@require python version > 3
-Need to import numPy library as np that will help creating grid with zeroes in it initially. And this will board will appear on console
- Import Math library
- import sys to close and open the new window that will show the current four game animarion
-Import pygame to see animation of connect four game

ConnnectFour.py
This is a simple algorithm to run connect four game. It chooses the best score, but does not look at every combination to achieve the best score. The AI or BOT will pick move randomly. There is no smart move made by Bot in this version.

connectFourMinMax.py
This algorithm is designed to make AI bit smarter and always choose the center move to if it's an AI's turn first. This increases the chance of winning. Moreover, every move is evaluated first and then implement it based on scores. However, you will notice, this algo takes longer when we increase the look-up depth. For example, set the dept to 5 or 6 in the main program loop, it will take forever to make a move, since it is looking for every combination of a winning move.

connectFourAlphaBeta.py
This is a same algo as connectFourMinMax.py, but here the lookup time is way better than it's previous version. Since Alpha-beta pruning is implemented in the minMax algorithm. Set the depth to 5 or 6 and compare it with connectFourMinMax.py with the same depth. You'll notice, this version does not take long time to make a move even when the depth is deeper.


connectfour's People

Contributors

abinashi7 avatar

Watchers

James Cloos avatar  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.