- memset(st->board, 0, st->widthb * st->height * sizeof(*st->board));
- if (st->recurse)
- recurse(st, st->width << 7, st->height << 7, st->length);
- else
- iterate(st, pow(st->lensnum, st->length));
- if (st->npoints)
- drawpoints(st);
-
+ x = st->width << 7;
+ y = st->height << 7;
+
+ if (st->multi) {
+ for (i = 0; i < st->lensnum; i++) {
+ partcolor = st->ccolour * (i+1);
+ partcolor %= st->ncolours;
+ XSetForeground(st->dpy, st->gc, st->colours[partcolor].pixel);
+ memset(st->board, 0, st->widthb * st->height * sizeof(*st->board));
+ if (st->recurse)
+ recurse(st, x, y, st->length - 1, i);
+ else
+ iterate(st, pow(st->lensnum, st->length - 1), i);
+ if (st->npoints)
+ drawpoints(st);
+ }
+ }
+ else {
+
+ XSetForeground(st->dpy, st->gc, st->colours[st->ccolour].pixel);
+ memset(st->board, 0, st->widthb * st->height * sizeof(*st->board));
+ if (st->recurse)
+ recurse(st, x, y, st->length, 0);
+ else
+ iterate(st, pow(st->lensnum, st->length), 0);
+ if (st->npoints)
+ drawpoints(st);
+ }
+