scope renderLineCompedSingleLevels. sS renderLineCompedSingleLevels(LineCompedSingle lc) { // each byte is the character's "color" // (0 for empty, 1 for color one, 2 for color two) byte[][] rows = renderLineCompedSingleLevels_raw(lc); S text = uncompressLineCompedSingle(lc); fill(lc, rows, 0, 0, lc.main, 1); //printVars(+rows); ret lines(map(rows, row -> { StringBuilder buf = new(n); for i to n: { if (row[i] == 0) buf.append(i == n-1 ? " " : " "); else { buf.append(text.charAt(i)); if (i < n-1) buf.append(row[i+1] != 0 && row[i+1] != row[i] ? '|' : ' '); } } ret str(buf); })); } // returns new x static int #fill(LineCompedSingle lc, L rows, int x, int y, L symbols, int color) { printVars_str fill(+x, +y, +symbols, +color); for (int idx : symbols) { if (idx < l(lc.literals)) { rows.get(y)[x] = (byte) color; x++; } else { int newX = fill(lc, rows, x, y+1, intPairToList(lc.getPair(idx)), color); while (x < newX) rows.get(y)[x++] = (byte) color; color = 3-color; } } ret x; } end scope