Git Product home page Git Product logo

connectfour's Introduction

ConnectFour

In this repository, I will attempt to make an AI Connect Four using the minimax algorithm. This serves as an easy review of the Minimax Algorithm. In this game, the player starts first and goes against an AI with 3 level of difficulties. The first level corresponds to a depth of 1 in the minimax algorithm, the second level corresponds to a 2 and the third level corresponds to a 4. Notice how in the 3rd level, the time it takes for the AI to move is longer (This is especially true if I put 5, the AI would take about 30 seconds to make a guess.)

The Game:

  • To run the game, launch pyplay.py

Level 1 with depth of 1

Level 2 with depth of 3

Level 3 with depth of 4

  • The gif conversion from video cut off the AI winning; however, for level 3, it was almost impossible to win (as I am really bad at the game).

Acknowledgement

I used the evaluate function below
[1] https://softwareengineering.stackexchange.com/questions/263514/why-does-this-evaluation-function-work-in-a-connect-four-game-in-java

I followed the minimax pseudo code defined in wikipedia
[2] https://en.wikipedia.org/wiki/Minimax

connectfour's People

Contributors

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