public static void print(int[][] table, CustomLogic logic) {
        int padding = String.valueOf(table[table.length - 1][table[0].length - 1]).length();
        String strFmt = " %" + padding + "s |";
        String dgtFmt = " %" + padding + "s |";
        String sep = "+";
        for (int i = 0; i < padding + 2; i++) sep = "-" + sep;
        StringBuilder str = new StringBuilder();
        str.append(String.format(strFmt, 'X'));
        for (int i = 1; i <= table.length; i++) {
            str.append(String.format(dgtFmt, i));
        }
        str.append('\n');
        for (int i = 0; i <= table.length; i++) {
            str.append(sep);
        }
        for (int i = 0; i < table[0].length; i++) {
            str.append('\n');
            str.append(String.format(dgtFmt, i + 1));
            for (int j = 0; j < table.length; j++) {
                if (logic.call(table[j][i])) {
                    str.append(String.format(dgtFmt, table[j][i]));
                } else {
                    str.append(String.format(strFmt, ' '));
                }
            }
        }
        System.out.println(str.toString());
    }