How to Program a Connect 4 AI (implementing the minimax algorithm)
Learn data skills with hands-on exercises & tutorials at Datacamp! https://datacamp.pxf.io/c/3588040/1012793/13294 In this video we take the connect 4 game that we built in the How to Program Connect 4 in Python series and add an expert level AI to it. 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. Here is the link to the code we started with: https://github.com/KeithGalli/Connect4-Python To understand the theory behind this code, make sure to watch this video on how a board game AI works: https://youtu.be/y7AKtWGOPAE To understand alpha-beta pruning, check out this video: https://youtu.be/l-hh51ncgDI To build the game we started out with, watch these four videos: 1. https://youtu.be/UYgyRArKDEs 2. https://youtu.be/zD-Xuu_Jpe4 3. https://youtu.be/SDz3P_Ctm7U 4. https://youtu.be/krCKxcrHeN4 If you want to send me your finished AI, email me: [email protected] Follow me on social media too please :) https://www.instagram.com/keithgalli/ https://twitter.com/keithgalli/ Thanks for watching! Hope you all learning something SUBSCRIBE to not miss out on any future videos --------------------- If you are curious to learn how I make my tutorials, check out this video: https://youtu.be/LEO4igyXbLs Join the Python Army to get access to perks! YouTube - https://www.youtube.com/channel/UCq6XkhO5SZ66N04IcPbqNcw/join Patreon - https://www.patreon.com/keithgalli *I use affiliate links on the products that I recommend. I may earn a purchase commission or a referral bonus from the usage of these links.
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.