static int computeMove() throws IOException {
        Engine.actualColor = Engine.color; // Setam culoarea engineului pentru evaluare
        
        if ("black".equals(Engine.color)) {
            if (Database.blackOpening.isEmpty()) {
                ArrayList move = Engine.alfaBeta(Integer.MIN_VALUE, Integer.MAX_VALUE, 2); // Preluam mutarea de la Alfa-Beta
                
                if(move.size() < 2){ // Daca nu mai sunt mutari, iesim
                    return 1;
                }
                
                Random rand = new Random();
                int n = rand.nextInt(move.size() - 1) + 1; // Alegem o mutare random dintre cele cu acelasi scor maxim din NegaMax
                
                
                recordMove((String) move.get(n)); // Inregistram mutarea finala
                Logger.write("LOGGER::" + Engine.color + "::" + "Am facut mutarea: " + (String) move.get(n));
                System.out.println("move " + (String) move.get(n)); // Trimitem mutarea din Alfa-Beta la winboard
            } else {
                String nextMove = Database.nextBlackMove(); // Preluam urmatoarea mutare din DB
                int v[][] = Board.translatePosition(nextMove.charAt(0) + "" + nextMove.charAt(1) + "" + nextMove.charAt(2) + "" + nextMove.charAt(3));
                if(Board.isWhitePiece(v[1][0], v[1][1]) && (Board.board[v[0][0]][v[0][1]] == 'p')){
                    Database.blackOpening.clear();
                    return -1;
                }
                recordMove(nextMove); // O inregistram
                System.out.println("move " + nextMove); //Trimitem mutarea din DB la winboard
            }
        } else {
            if (Database.whiteOpening.isEmpty()) {
                ArrayList move = Engine.alfaBeta(Integer.MIN_VALUE, Integer.MAX_VALUE, 2); // Preluam mutarea de la Alfa-Beta
                
                if(move.size() < 2){ // Daca nu mai sunt mutari, iesim
                    return 1;
                }
                
                Random rand = new Random();
                int n = rand.nextInt(move.size() - 1) + 1; // Alegem o mutare random dintre cele cu acelasi scor maxim din NegaMax              
                
                
                recordMove((String) move.get(n)); // Inregistram mutarea finala
                Logger.write("LOGGER::" + Engine.color + "::" + "Am facut mutarea: " + (String) move.get(n));
                System.out.println("move " + (String) move.get(n)); // Trimitem mutarea din Alfa-Beta la winboard
            } else {
                String nextMove = Database.nextWhiteMove(); // Preluam urmatoarea mutare din DB
                int v[][] = Board.translatePosition(nextMove.charAt(0) + "" + nextMove.charAt(1) + "" + nextMove.charAt(2) + "" + nextMove.charAt(3));
                if(Board.isBlackPiece(v[1][0], v[1][1]) && (Board.board[v[0][0]][v[0][1]] == 'P')){
                    Database.whiteOpening.clear();
                    return -1;
                }
                recordMove(nextMove); // O inregistram
                System.out.println("move " + nextMove); //Trimitem mutarea din DB la winboard
            }
        }
        
        return 1;
    }