@@ -13,11 +13,10 @@ public class Game {
1313 // Define Global Variable
1414 static RNG random = new RNG ();
1515 static Score score = new Score ();
16+ // Set notification Check Point. Default to 2048
1617 final static int iCheckPoint = 2048 ;
1718 static int [][] arrDimension ;
18- //static int[][] arrDimension = {{0,4,2,2},{2,2,2,0},{2,2,2,4},{4,2,2,0}};
19- //static int[][] arrDimension = {{0,0,2,0},{2,0,2,0},{4,0,0,0},{2,2,2,0}};
20- // Board Dimension
19+ // Board Dimension. Default: 4
2120 static int iDimension = 4 ;
2221 static int [] arrNumberPool = {2 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,4 };
2322 static boolean isGameOver = false ;
@@ -94,15 +93,12 @@ public static void main(String[] args) {
9493
9594 if (sInput .equalsIgnoreCase ("w" )){
9695 if (SlideValue (iDimension , arrDimension , 1 , false )) randSetValue (iDimension , arrDimension , false );
97- //SlideValue(iDimension, arrDimension, 1);
9896 }else if (sInput .equalsIgnoreCase ("s" )){
9997 if (SlideValue (iDimension , arrDimension , 2 , false )) randSetValue (iDimension , arrDimension , false );
10098 }else if (sInput .equalsIgnoreCase ("a" )){
10199 if (SlideValue (iDimension , arrDimension , 3 , false )) randSetValue (iDimension , arrDimension , false );
102- //SlideValue(iDimension, arrDimension, 3);
103100 }else if (sInput .equalsIgnoreCase ("d" )){
104101 if (SlideValue (iDimension , arrDimension , 4 , false )) randSetValue (iDimension , arrDimension , false );
105- //SlideValue(iDimension, arrDimension, 4);
106102 }else {
107103 System .out .print ("Your input is not defined! Consider w,s,a, or d!" );
108104 System .out .print ("Press any key to continue..." );
@@ -181,7 +177,7 @@ public static boolean SlideValue(int iDimension, int[][] arrTile, int iSlidePosi
181177 }
182178
183179 if (iStep == 0 ){
184- //System.out.println(" No Move!");
180+ // No move anymore
185181 return false ;
186182 }
187183 }else if (iSlidePosition == 2 ){
@@ -235,7 +231,7 @@ public static boolean SlideValue(int iDimension, int[][] arrTile, int iSlidePosi
235231 }
236232
237233 if (iStep == 0 ){
238- //System.out.println(" No Move!");
234+ // No move anymore
239235 return false ;
240236 }
241237 }else if (iSlidePosition == 3 ){
@@ -341,7 +337,7 @@ public static boolean SlideValue(int iDimension, int[][] arrTile, int iSlidePosi
341337 }
342338
343339 if (iStep == 0 ){
344- //System.out.println(" No Move!");
340+ // No move anymore
345341 return false ;
346342 }
347343 }
0 commit comments