All the required guidelines and required java files are attached in the files
import java.util.Scanner; public class TwoDimensional2048 implements TwoDimensional{ public static void main(String[] args) { int[][] b, br, brc; int[][] b2; int tmp; int[][] initb = { {0,2,0,0,2}, {0,2,0,0,0}, {0,2,0,2,0}, {0,2,0,2,2}, {2,0,2,0,0}}; int[][] lb = { {4,0,0,0,0}, {2,0,0,0,0}, {4,0,0,0,0}, {4,2,0,0,0}, {4,0,0,0,0}}; int[][] ub = { {2,4,2,4,4}, {0,4,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}}; int[][] rb = { {0,0,0,0,4}, {0,0,0,0,2}, {0,0,0,0,4}, {0,0,0,2,4}, {0,0,0,0,4}}; int[][] db = { {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,4,0,0,0}, {2,4,2,4,4}}; int[][] multb = { {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,0}, {0,0,0,0,4}, {0,0,0,0,16}}; int[][] bprerot = { {0,0,2,2}, {0,2,2,0}, {0,2,0,2}, {2,0,0,0}, {0,2,0,2}, {0,0,0,2}, {0,0,0,0}}; int[][] brot1 = { {2,0,2,0,2,2,0}, {2,2,0,0,0,0,0}, {0,2,2,0,2,0,0}, {0,0,0,2,0,0,0}}; int[][] brot3 = { {0,0,0,2,0,0,0}, {0,0,2,0,2,2,0}, {0,0,0,0,0,2,2}, {0,2,2,0,2,0,2}}; // Check the creation of boards, and adding new values // to the board. TwoDimensional2048 T =new TwoDimensional2048(); b = T.blankBoard(5, 5); assert(T.validateBoard(b)); for (int i = 0 ; i < 10="" ;="" i++)="" {="" t.addnewvalue(b);="" }="" assert(t.validateboard(b));="" tmp="b[1][4];" b[1][4]="33;" assert(!t.validateboard(b));="" b[1][4]="tmp;" assert(t.identicalboard(initb,="" b));="" check="" if="" the="" randcoord="" method="" works="" brc="T.blankBoard(5," 6);="" add="" in="" some="" random="" values="" brc[0][0]="2;" brc[1][1]="2;" brc[2][2]="2;" brc[3][3]="2;" brc[4][4]="2;" brc[4][5]="2;" int[][]="" coordanswers="{" {0,="" 1},="" {3,="" 2},="" {2,="" 0},="" {0,="" 4}};="" for="" (int="" i="0" ;="" i="">< 4="" ;="" i++)="" {="" int[]="" coord="T.randCoord(brc," (i="" *="" 41)%t.numunoccupied(brc));="" assert(coord[0]="=" coordanswers[i][0]="" &&="" coord[1]="=" coordanswers[i][1]);="" }="" check="" rotation.="" br="T.blankBoard(7," 4);="" for="" (int="" i="0" ;="" i="">< 10 ; i++) { t.addnewvalue(br); } assert(t.validateboard(br)); assert(t.identicalboard(br, bprerot)); br = t.rotateleft(br); assert(t.identicalboard(br, brot1)); br = t.rotateleft(t.rotateleft(br)); assert(t.identicalboard(br, brot3)); // check the movement operations. b2 = b; b = t.left(b2); assert(t.identicalboard(lb, b)); b = t.up(b2); assert(t.identicalboard(ub, b)); b = t.right(b2); assert(t.identicalboard(rb, b)); b = t.down(b2); assert(t.identicalboard(db, b)); b = b2; b = t.left(b); b = t.up(b); b = t.right(b); b = t.down(b); b = t.right(b); b = t.down(b); assert(t.identicalboard(multb, b)); // please add your checks below 10="" ;="" i++)="" {="" t.addnewvalue(br);="" }="" assert(t.validateboard(br));="" assert(t.identicalboard(br,="" bprerot));="" br="T.rotateLeft(br);" assert(t.identicalboard(br,="" brot1));="" br="T.rotateLeft(T.rotateLeft(br));" assert(t.identicalboard(br,="" brot3));="" check="" the="" movement="" operations.="" b2="b;" b="T.left(b2);" assert(t.identicalboard(lb,="" b));="" b="T.up(b2);" assert(t.identicalboard(ub,="" b));="" b="T.right(b2);" assert(t.identicalboard(rb,="" b));="" b="T.down(b2);" assert(t.identicalboard(db,="" b));="" b="b2;" b="T.left(b);" b="T.up(b);" b="T.right(b);" b="T.down(b);" b="T.right(b);" b="T.down(b);" assert(t.identicalboard(multb,="" b));="" please="" add="" your="" checks=""> 10 ; i++) { t.addnewvalue(br); } assert(t.validateboard(br)); assert(t.identicalboard(br, bprerot)); br = t.rotateleft(br); assert(t.identicalboard(br, brot1)); br = t.rotateleft(t.rotateleft(br)); assert(t.identicalboard(br, brot3)); // check the movement operations. b2 = b; b = t.left(b2); assert(t.identicalboard(lb, b)); b = t.up(b2); assert(t.identicalboard(ub, b)); b = t.right(b2); assert(t.identicalboard(rb, b)); b = t.down(b2); assert(t.identicalboard(db, b)); b = b2; b = t.left(b); b = t.up(b); b = t.right(b); b = t.down(b); b = t.right(b); b = t.down(b); assert(t.identicalboard(multb, b)); // please add your checks below>