void generate() {
        try {
            //Randomisation du point de départ
            Random randomGenerator = new Random();

            int firstRand = randomGenerator.nextInt(4);
            if (firstRand == 0) { //Point de départ en haut
                this.startY = 0;
                this.startX = randomGenerator.nextInt(caseArray.length);
                caseArray[startX][startY].breakTopWall();
            }
            if (firstRand == 1) { //Point de départ a droite
                this.startY = randomGenerator.nextInt(caseArray[0].length);
                this.startX = caseArray.length - 1;
                caseArray[startX][startY].breakRightWall();
            }
            if (firstRand == 2) { //Point de départ en bas
                this.startY = caseArray[0].length - 1;
                this.startX = randomGenerator.nextInt(caseArray.length);
                caseArray[startX][startY].breakBottomWall();
            }
            if (firstRand == 3) { //Point de départ a gauche
                this.startY = randomGenerator.nextInt(caseArray[0].length);
                this.startX = 0;
                caseArray[startX][startY].breakLeftWall();
            }


            caseArray[startX][startY].setState(true);
            Coordinates start = new Coordinates(startX, startY);
            Coordinates actual = start;
            //Chemin en cours
            Stack<Coordinates> cellStack = new Stack<Coordinates>();
            int longerPathSize = 0;

            //Labyrinthe en creation
            while (cellsVisited < cells) {
                if (this.getNeighboursFree(actual) != null) {    //Si on a des voisins utilisables, on continue
                    Coordinates[] neighbours = this.getNeighboursFree(actual);
                    int nbr = neighbours.length;
                    int rand = randomGenerator.nextInt(nbr);
                    Coordinates target = new Coordinates(neighbours[rand].getX(), neighbours[rand].getY());

                    caseArray[neighbours[rand].getX()][neighbours[rand].getY()].setState(true);
                    this.breakWall(actual, target);
                    cellStack.push(actual);

                    actual = new Coordinates(target.getX(), target.getY());
                    cellsVisited++;
                } else {       //Si on a pas de voisins utilisables, on revient en arriére dans la stack
                    if (cellStack.size() > 0) {
                        if (cellStack.size() > longerPathSize) {
                            longerPathSize = cellStack.size();
                            this.endX = actual.getX();
                            this.endY = actual.getY();
                        }

                        Coordinates temp = cellStack.pop();

                        actual = new Coordinates(temp.getX(), temp.getY());
                    } else {
                        break;
                    }

                }

            }
        } catch (Exception e) {
            System.out.println("Unknown Error !");
        }
    }