CSE-8B / PA4 / starter / README.md
README.md
Raw
  1. 2048 is a simple addition game that takes numbers of the same value and add them together. The goal of this game is to get one of the tile to be the number 2048. The format of the game is that of a 4x4 board, and you can move in 4 directions: left, right, up, and down. The game would randomly generate the tile of the value two or four after every move. You can move the tiles as long as there are empty spaces within a certain direction and you can also move a direction if the tiles are equal to one another, in which the tiles would merge together.The game is over when one of your tile equals 2048, you can either choose to end the game or continue the game. However, you'll lose if you can no longer move within the board due to the lack of empty tiles, or you You can move within the game with the arrow keys on the keyboard. You can also move with the W,A,S,D keys, where W allows you to move up, A allows you to move left, S allowed you to move down, and D allows you to move right. Moreover, you can also move with the keys H,J,K, and L. H allows you to move left, J allows you to move down, K allows you to move up, and L allows you to move right.

  2. The benefits of having our magic numbers in the Config.java file is that it keeps the file organize, and easy to read. The purpose of setting these magic numbers in a scope accessible by all our code is that all the variables would be placed in a specific space, that'll help the programmer organize their work.

  3. We'd want to create a deep copy of the board rather than a shallow copy of the board because it'll allow us to create an identical board, where we could verify if the board mechanics are working like it's suppose to be. A shallow copy only copies the reference of an object, not its elements.