Giter Site home page Giter Site logo

connect-four-ai's Introduction

Connect Four Solver

What is this project?

  • Minimax Algorithm with α-β-Pruning
  • Transposition Table for Optimal Performance
  • Web-based Game built with Jindium

What is Connect Four?

Connect Four is a two-player board game in which the players take turns dropping coloured pieces from the top into a grid. The objective of the game is to be the first player to get four of their coloured discs in a row, either horizontally, vertically, or diagonally.

The grid consists of a vertical stack of seven columns and six rows. Players take turns dropping their discs into the top of one of the columns, and the disc falls to the lowest unoccupied row in that column.

The game ends when one of the players gets four of their discs in a row or when the grid is full and there is no winner.

Algorithmic Theory

A Minimax algorithm is a decision-making algorithm that is commonly used to determine the best move in a two-player game, such as Connect Four. It works by considering all possible moves that a player can make, and then evaluating the potential outcomes of those moves. This solution also utilises Alpha-beta pruning, which is a technique used to improve the efficiency of the minimax algorithm. It works by eliminating certain branches of the search tree that are unlikely to lead to the best possible move.

To solve connect four with a minimax algorithm and alpha-beta pruning, this algorithm first generates a search tree that represents all the possible moves that could be made in the game. It then evaluates the potential outcomes of each move and uses alpha-beta pruning to eliminate any branches of the tree that are unlikely to lead to the best possible move.

The algorithm then uses the remaining branches of the tree to determine the best move to make, based on the potential outcomes of each move. This would allow the algorithm to make strategic decisions that maximize its chances of winning the game.

connect-four-ai's People

Contributors

jackkimmins avatar

Stargazers

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