Advanced AI 2048 Game System

A Java Swing 2048 game with a Monte Carlo AI solver and local user profiles.

Course: Introduction to Computer Programming     Apr 2024 – May 2024

Overview

Engineered a modular 2048 game engine in Java Swing, supporting dual gameplay modes (Classic Powers of 2 & Custom Powers of 3) via an extensible OOP architecture to handle complex grid logic and merging rules.

Key Highlights

  • Core Game Engine & Architecture: Engineered a modular 2048 game engine in Java Swing, supporting dual gameplay modes (Classic Powers of 2 & Custom Powers of 3) via an extensible OOP architecture to handle complex grid logic and merging rules.
  • Monte Carlo AI Solver: Implemented an autonomous AI agent using Monte Carlo simulation algorithms (up to 1k iterations per decision step) to predict optimal moves to maximize scoring, enabling intelligent auto-play functionality.
  • Local Profiles & Save Files: Implemented local user profiles, Base64-encoded data, and MD5 checksums to detect changes to saved games.
  • Interactive Features & UI: Developed a rich graphical interface with dynamic themes (Ocean, Flame, Forest), background music integration, and advanced gameplay mechanics including “Hammer” props and infinite Undo history.

Technologies Used

  • Language: Java
  • GUI Framework: Java Swing
  • Algorithms: Monte Carlo Tree Search, MD5 Hashing, Base64 Encoding
  • Architecture Pattern: Model-View-Controller (MVC)

Start Page

Game Panel

Monte Carlo based AI feature