Warning: session_start(): open(/var/lib/php/sessions/sess_kra9fhp3533gl4a0qdp90lrf5k, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
scope renderLineCompedSingleLevels.
sS renderLineCompedSingleLevels(LineCompedSingle lc) {
int n = lcLength(lc);
// each byte is the character's "color"
// (0 for empty, 1 for color one, 2 for color two)
L rows = new AutoGrowingList<>(() -> new byte[n]);
fill(lc, rows, 0, 0, lc.main, 1);
ret lines(buf);
}
// returns new x
static int #fill(LineCompedSingle lc, L rows, int x, int y, L symbols, int color) {
for (int idx : symbols) {
if (idx < l(lc.literals)) {
// nothing to do?
ret x+1;
} else {
int newX = fill(lc, rows, x, y+1, idx, color);
while (x < newX) rows.get(y)[x++] = color;
color = 3-color;
}
}
ret x;
}
end scope