GithubHelp home page GithubHelp logo

ana06 / contact4 Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 782 KB

The Connect Four game implemented in C++ using the minimax algorithm and different heuristics

License: MIT License

C++ 100.00%
alpha-beta-pruning game minimax-algorithm heuristics

contact4's Introduction

Contact 4

The Connect Four game implemented in C++ using the minimax algorithm, different heuristics and alpha–beta pruning. Heuristics has been proved to be essential to be able to play in big boards moving in a reasonable period of time. Alpha-beta pruning has also been proved to reduce significantly the amount of time needed to select a movement.

The executable used for the analysis is contact4.cpp. There are three types of game: human against human, human against machine and machine again machine. Taking into account all the analysis made, a playable version of the game (contact4Juego.cpp) has been implemented to play the human against machine version with different levels of difficulty. The machine chooses the best move that it can find in a reasonable period of time. In the case that several moves are considered to be equally good, one of them is choosen randomnly to avoid playing always the same game.

The number of rows and columns can also be choosen. Typically this game is played with 6 rows and 7 columns, but in that case the player who starts alsways win if he plays well. For example, with 7 rows and 7 columns the second player can achive a draw even if the fisrt player plays well.

The project was Implemented in May 2014. Comments are in Spanish. contact4-AnaMariaMartinez.pdf is a detailed report in Spanish about the implementation and the analysis made.

Authors

This project was developed by Ana María Martínez Gómez.

Licence

Code published under MIT license (see LICENSE).

contact4's People

Contributors

ana06 avatar

Stargazers

 avatar

Watchers

 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.