The verification is taking for a long time and I cannot know where I have a mistake.
Can you help me?
package com.codegym.games.game2048;
import com.codegym.engine.cell.*;
import com.codegym.engine.cell.Game;
public class Game2048 extends Game {
private static final int SIDE = 4;
private int[][] gameField = new int[SIDE][SIDE];
@Override
public void initialize(){
createGame();
setScreenSize(SIDE, SIDE);
drawScene();
}
private void createGame(){
createNewNumber();
}
private void drawScene(){
for (int i = 0; i < SIDE; i++) {
for (int j = 0; j < SIDE ; j++) {
setCellColor(i, j, Color.RED);
}
}
}
private void createNewNumber(){
int xRandom = 1;
int yRandom = 1;
int prob = getRandomNumber(10);
while (xRandom != 0 && yRandom!=0){
xRandom = getRandomNumber(SIDE);
yRandom = getRandomNumber(SIDE);
}
if (prob == 9){
gameField[xRandom][yRandom] = 4;
}else{
gameField[xRandom][yRandom] = 2;
}
}
}