Develop an AI to play Connect Four – Python Tutorial


Learn how to create an expert level artificial intelligence to play Connect Four using Python. We start out with a very simple implementation of just dropping a piece randomly and then progress to choosing a column based on score and then finally implementing the minimax algorithm with alpha beta pruning.

💻 Initial code:

🎥Developing the initial connect four game:
🎥How a board game AI works:
🎥Alpha-beta pruning:

Video from Keith Galli. Check out his channel:

Keith on social media:

Learn to code for free and get a developer job:

Read hundreds of articles on programming:

And subscribe for new videos on technology every day:

Similar Posts:

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?


  1. Sorry but MiniMax with Alpha-Beta pruning is NOT an A.I. Please don't use clickbait titles just for views. Looking forward to a solution with a simple NN, GAN or LSTM.

  2. I love Python and I'll love learn AI, but in Portuguese there are few videos about AI in Python.
    My English is basic. I can understand few words and expressions in the video.
    Translate this video to Portuguese from Brazil if it is possible. PLEASE
    (Some words may be wrong, thanks)

Leave a Reply

Your email address will not be published. Required fields are marked *