Honors Contract Project • COSC 461 • Winter 2026

Connect 4 AI

Java game engine with two AI opponents (Min-Max and Monte Carlo Tree Search), plus a simulation harness for head-to-head analysis.

Java Min-Max Monte Carlo Tree Search OOP JUnit

Overview

Built as an Honors Contract for EMU's Introduction to Artificial Intelligence course, this project explores how two classical adversarial-search algorithms, Min-Max with alpha-beta pruning and Monte Carlo Tree Search (MCTS), perform on the same game under matched conditions. The result is a working Connect 4 engine, two interchangeable AI opponents, and a simulation harness that runs hundreds of games between them to surface meaningful win-rate trends.

Approach

  • Developed a Connect 4 game engine in Java with clean OOP separation between board state, move generation, rules, and player agents, making algorithms swappable behind a shared Player interface.
  • Implemented Min-Max with alpha-beta pruning and a Monte Carlo Tree Search agent (selection, expansion, simulation, backpropagation) as the two AI opponents.
  • Built a simulation framework to pit the algorithms against each other over hundreds of games, varying depth/iteration budgets to analyze win-rate trends.
  • Wrote unit tests to validate move generation, terminal-state detection, and AI behavior under constrained budgets.

Results & Learnings

  • Authored an accompanying paper covering what I learned, the challenges I ran into along the way, and instructions for running the program.
  • Reinforced how the right design pattern (strategy + clean interfaces) makes swapping search algorithms a one-line change rather than a rewrite.
  • Gave me hands-on intuition for when MCTS's randomized rollouts catch up to (and overtake) Min-Max as game complexity grows.

Media

AI vs. AI Simulation

The simulation harness pits the two search algorithms against each other over many games and reports the resulting win-rate trends.

Playing Against an AI

A human player can take on either AI opponent directly from the terminal.

← Back to all projects