/Connect4-with-AI

Connect 4 using MiniMax Algorithm

Primary LanguagePython

Connect 4 with AI

Game Description

Connect 4 is a two-player game in which the players first choose a color and then take turns dropping their colored discs from the top into a grid. The pieces fall straight down, occupying the next available space within the column. The objective of the game is to connect-four ofone’s own discs of the same color next to each other vertically, horizontally, or diagonally. Thetwo players keep playinguntil the board is full. The winner is the player havinggreaternumber of connected-fours.

Algorithm

MiniMax algoritm with alpha-beta pruning and also without alpha-beta pruning

GUI

K is the depth of the search tree Screen Shot 2021-12-17 at 8 48 37 PM Screen Shot 2021-12-17 at 8 48 53 PM Screen Shot 2021-12-17 at 8 49 45 PM Screen Shot 2021-12-17 at 8 49 56 PM