@@ -13,11 +13,10 @@ public class Game {
13
13
// Define Global Variable
14
14
static RNG random = new RNG ();
15
15
static Score score = new Score ();
16
+ // Set notification Check Point. Default to 2048
16
17
final static int iCheckPoint = 2048 ;
17
18
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
21
20
static int iDimension = 4 ;
22
21
static int [] arrNumberPool = {2 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,2 ,4 };
23
22
static boolean isGameOver = false ;
@@ -94,15 +93,12 @@ public static void main(String[] args) {
94
93
95
94
if (sInput .equalsIgnoreCase ("w" )){
96
95
if (SlideValue (iDimension , arrDimension , 1 , false )) randSetValue (iDimension , arrDimension , false );
97
- //SlideValue(iDimension, arrDimension, 1);
98
96
}else if (sInput .equalsIgnoreCase ("s" )){
99
97
if (SlideValue (iDimension , arrDimension , 2 , false )) randSetValue (iDimension , arrDimension , false );
100
98
}else if (sInput .equalsIgnoreCase ("a" )){
101
99
if (SlideValue (iDimension , arrDimension , 3 , false )) randSetValue (iDimension , arrDimension , false );
102
- //SlideValue(iDimension, arrDimension, 3);
103
100
}else if (sInput .equalsIgnoreCase ("d" )){
104
101
if (SlideValue (iDimension , arrDimension , 4 , false )) randSetValue (iDimension , arrDimension , false );
105
- //SlideValue(iDimension, arrDimension, 4);
106
102
}else {
107
103
System .out .print ("Your input is not defined! Consider w,s,a, or d!" );
108
104
System .out .print ("Press any key to continue..." );
@@ -181,7 +177,7 @@ public static boolean SlideValue(int iDimension, int[][] arrTile, int iSlidePosi
181
177
}
182
178
183
179
if (iStep == 0 ){
184
- //System.out.println(" No Move!");
180
+ // No move anymore
185
181
return false ;
186
182
}
187
183
}else if (iSlidePosition == 2 ){
@@ -235,7 +231,7 @@ public static boolean SlideValue(int iDimension, int[][] arrTile, int iSlidePosi
235
231
}
236
232
237
233
if (iStep == 0 ){
238
- //System.out.println(" No Move!");
234
+ // No move anymore
239
235
return false ;
240
236
}
241
237
}else if (iSlidePosition == 3 ){
@@ -341,7 +337,7 @@ public static boolean SlideValue(int iDimension, int[][] arrTile, int iSlidePosi
341
337
}
342
338
343
339
if (iStep == 0 ){
344
- //System.out.println(" No Move!");
340
+ // No move anymore
345
341
return false ;
346
342
}
347
343
}
0 commit comments