Diego Malagrida Modified Connect 4 Agent ↑ Top

Authors Diego Malagrida GonzálezAndreu Massanet Felix

Published9 Jun 2026

Sectionalgorithms, game-development

Modified Connect 4 Agent

Adversarial search on a Connect 4 variant (minimax, alpha-beta and a transposition table) with a tournament to prove which agent is actually stronger.

The application window with a Connect 4 board of yellow and red discs, and the agent configuration panel beside it.
A match in progress against the alpha-beta agent.

Overview

A Java Swing application that plays a modified Connect 4 with adversarial search: minimax with alpha-beta pruning and a transposition table, a human mode, and agent-versus-agent tournaments.

The strongest agent explores the game tree assuming the opponent plays optimally, prunes the branches that cannot change its decision, and stops at a depth where a heuristic scores the position instead. A transposition table keeps positions that can be reached by different move orders from being searched twice.

Alongside it the application ships a spectrum of weaker agents, from trivial to probabilistic. That is what the tournament mode is for: an agent that beats a human once has proved nothing, and playing every agent against every other one is the only claim about strength worth making.

Project 6 of 7 for the Advanced Algorithms course at the Universitat de les Illes Balears, the one on adversarial search.

javaadversarial-searchgame-ai

← All projects