less than 1 minute read

When I enrolled in University of Pennsylvania’s CIS110, I chose to think of an implementation of the 2048 game for my final project.

The objective was to write clean, well organised object-oriented code. You can find my corresponding GitHub repository here.

I structured the project as follows:

  • The Tile class implements the Tile object, that represents individual Tiles
  • The Board class implements the Board object, that simulates the group of Tiles considered together, and how they interact
  • TileInterface.java describes the API for the Tile class
  • BoardInterface.java describes the API for the Board class
  • TwoThousandFortyEight.java coordinates these different objects and calls the right methods on it depending on the input from the user so as to actually simulate a 2048 game