The code below is an attempt to use more than one generator (in this case two) to generate a fractal using the standard iterative procedure involving generators. Only the first two stages of the construction are included. Ideally, for each line segment one of the two generators would be applied selected at random. This would be similar to Mandelbrot's stock chart cartoons including what he called shuffling. An y help with streamlining the code would be aoppreciated
{a1, b1} = {.3, .6}; {a2, b2} = {.7, .2};
{c1, d1} = {.2, .7}; {c2, d2} = {.6, .3};
Clear[y1, f1, g1, h1, i1, j1, k1];
Clear[y2, f2, g2, h2, i2, j2, k2];
y0[x_] := x;
If[RandomInteger[] == 1,
f1[x_] := b1*y0[x*1/a1];
g1[x_] := (b2 - b1)*y0[(x - a1)/(a2 - a1)] + b1;
h1[x_] := (1 - b2)*y0[(x - a2)/(1 - a2)] + b2;
y1[x_] /; 0 <= x < a1 := f1[x];
y1[x_] /; a1 <= x < a2 := g1[x];
y1[x_] := h1[x],
i1[x_] := d1*y0[x*1/c1];
j1[x_] := (d2 - d1)*y0[(x - c1)/(c2 - c1)] + d1;
k1[x_] := (1 - d2)*y0[(x - c2)/(1 - c2)] + d2;
y1[x_] /; 0 <= x < c1 := i1[x];
y1[x_] /; c1 <= x < c2 := j1[x];
y1[x_] := k1[x]]
If[RandomInteger[] == 1,
f2[x_] := b1*y1[x*1/a1];
g2[x_] := (b2 - b1)*y1[(x - a1)/(a2 - a1)] + b1;
h2[x_] := (1 - b2)*y1[(x - a2)/(1 - a2)] + b2;
y2[x_] /; 0 <= x < a1 := f2[x];
y2[x_] /; a1 <= x < a2 := g2[x];
y2[x_] := h2[x],
i2[x_] := d1*y1[x*1/c1];
j2[x_] := (d2 - d1)*y1[(x - c1)/(c2 - c1)] + d1;
k2[x_] := (1 - d2)*y1[(x - c2)/(1 - c2)] + d2;
y2[x_] /; 0 <= x < c1 := i2[x];
y2[x_] /; c1 <= x < c2 := j2[x];
y2[x_] := k2[x]]
Plot[y1[x], {x, 0, 1}, PlotRange -> {{0, 1}, {0, 1}}]
Plot[y2[x], {x, 0, 1}, PlotRange -> {{0, 1}, {0, 1}}]