private boolean noValidMoves(){
        int capturedLoc = (getPlayerToMove() - 1) * 25;
        if (getCount(capturedLoc) != 0){ //player has a captured piece
            if (isValid(capturedLoc) != 0) return false;
            if (changeSelectedDie()){
                if (isValid(capturedLoc) != 0){
                    changeSelectedDie();
                    return false;
                }
                changeSelectedDie();
            }
        }
        else{
            for (int i = 1; i < 25; i++){
                if (isValid(i) != 0) return false;
            }
            if (changeSelectedDie()){
                for (int i = 1; i < 25; i++){
                    if (isValid(i) != 0){
                        changeSelectedDie();
                        return false;
                    }
                }
                changeSelectedDie();
            }
        }
        return true;
    }