Connect 4 AI

The game is developed entirely in java using the Swing graphics library. It is developed against a simple AI, but it is not easy to beat. The program was developed in Colombia, so it is in Spanish, but it is intuitive and can be played even if you don't understand the language. Test your board game skills and challenge my work!

Affiliation: University of Nariño (Colombia)
Genre: Board Game
Platform: Windows PC, Linux
Development Environment: NetBeans
Language: Java
Production Period: April 2017 - May 2017
Number of team members: 1 programmer

Personal Contributions


Graphical user interface


To make it intuitive for everyone to play, a graphical interface with blue and red tones has been adopted to help distinguish the chips on the board. Also implements alerts to let know who the winner is in a window, and at the top of the window is a clearly visible button to restart or start the game.


Artificial Intelligence


This university task was specifically to implement artificial intelligence. The intelligence evaluates both squares and rows and simulates different possibilities to choose the best option. It can also distinguish whether a square is already occupied or not, and simulates the placement of pieces and the consequences of each move.


Alert when you win


An alert system has also been implemented to show when there is a winner. The game automatically detects when four tiles are lined up, horizontally, vertically or diagonally. Winning is exactly the same as in the original board game.
The alerts also include a button to close the window and resume the game.