public void maybeWrite(Board result, PrintWriter printWriter) {
        boolean hasZeroes = false;
        boolean hasSuggestions = false;
        StringBuilder simpleText = new StringBuilder();
        StringBuilder htmlBuilder = new StringBuilder();
        htmlBuilder.append("<div id=\"board\">");
        for (int row=0; row<result.rows; row++) {
            for (int col=0; col<result.cols; col++) {
                Pos pos = new Pos(row, col);
                if (boardSpec.possibleBombs.contains(pos)) {
                    if (result.eithers.contains(pos)) {
                        simpleText.append('#');
                        htmlBuilder.append(getHtml("unknown"));
                    } else if (result.bombs.contains(pos)) {
                        simpleText.append('b');
                        htmlBuilder.append(getHtml("mine"));
                        hasSuggestions = true;
                    } else {
                        simpleText.append('c');
                        htmlBuilder.append(getHtml("clearable"));
                        hasSuggestions = true;
                    }
                } else if (boardSpec.placesToCount.contains(pos)) {
                    int count = result.getCount(pos);
                    simpleText.append(count);
                    if (count == 0) {
                        hasZeroes = true;
                    }
                    htmlBuilder.append(getHtml(count));
                } else {
                    char c = boardSpec.get(pos);
                    simpleText.append(c);
                    htmlBuilder.append(getHtml(c));
                }
            }
            simpleText.append('\n');
            htmlBuilder.append("<br/>\n");
        }
        if (hasSuggestions && !hasZeroes) {
            System.out.println(simpleText.toString());
            System.out.println();
            htmlBuilder.append("<br/>\n");
            htmlBuilder.append("</div>");
            String html = htmlBuilder.toString();
            printWriter.write(html);
            printWriter.write(escape(html));
        }
    }