Skip to content

Latest commit

 

History

History
17 lines (17 loc) · 1.21 KB

README.md

File metadata and controls

17 lines (17 loc) · 1.21 KB

connect-4-AI

based on minimax algorithm with aplha-beta prunning
Implementation of Connect 4 game with AI.

alt text

In the original state all the places in the board are empty denoted by 0 in each place.The player-pieces are denoted by 1 and the AI-pieces are denoted by 2 alt text

As the game proceeds the player has to choose a column from 0 to size of board - 1 and put his piece there . If its a valid move then AI also places its piece. The game continues till any of the 2 players get 4 of his pieces in a row horizontally, vertically or diagonally. alt text

Features
Terminal based game - works completely on terminal
Depth 4 Minimax tree is generated to find next best move
Algorithm is optomized by alpha-beta prunning

Future Advancements
Gui can be added to make game more interesting.
Depth of tree can be increased to get better results.
Better and more detailed scoring can improve the results.