sS chess_makeFEN(LL recognized) { if (empty(recognized)) null; new LS out; for (LS row : recognized) { int i = 0; new StringBuilder buf; while (i < 8) { int j = smartIndexOfNot(row, "empty", i); if (j > i) { buf.append(j-i); i = j; } else { S p = row.get(i++); S piece = secondWord(p); char c = eq(piece, "knight") ? 'n' : first(piece); if (startsWith(p, "white")) c = upper(c); buf.append(c); } } out.add(str(buf)); } ret join("/", out); }