2048 Application in VBA



Game board
Download Excel Project

2048 is a highly addictive game popularized with the mobile game. My group recreated this game in Excel using VBA with our own twist.




Objective of game

2048 is played by sliding tiles in a cardinal direction; if tiles of the same number collide, they merge to form the sum of tiles. A new tile is generated randomly after each move. The goal is to reach a tile with the value of 2048 before the board fills up with tiles.




Game settings

A GUI has been implemented where users can choose from four preset difficulty options, or to choose their own rules. Each mode has a set number of special features that can be used



Auto-solve algorithm

The auto-solve function looks ahead and calculates the state of the board for every possible move the player can make. Each tile has an assigned number of points (larger values are worth more points), which the algorithm uses to determine which move will maximize the number of points.




Leaderboard

After the end of each game the player is sent ot a win/lose screen where they can enter there name to be recorded in the leaderboards.



Features:

  • Difficulty — Players can select different difficulties which include different numbers of blocked tiles and hints allowed
  • Free Tile — Resets the chosen tile, freeing it up for use
  • Undo — Cancels last move made by player
  • Counter — Real time update of current score
  • Reset — Resets the game to start over
  • Leaderboard — Keeps a list of names scores, number of moves and difficulty recorded at the end of each game
  • Hint — Pop up message that notifies player of the next move which will maximize points
  • Auto-play — Clicking "2048 Watson" initiates an algorithm to complete the game