I went back to a version that I had experimented with and changed
X := pi * SizeFactor * SizeFactor * SizeFactor;
Y := pj * SizeFactor * SizeFactor * SizeFactor;
to
X := pi * SizeFactor * SizeFactor;
Y := pj * SizeFactor * SizeFactor;
and that scaled level 1 OK.
I created 2 dynamic arrays which are:
Seeds: array of specialize TArray<TColor>; // Array to hold shuffled color arrays for each seed
ShuffledColors: specialize TArray<TColor>; // Temporary array for shuffled colors
but level 2 carpet is not five times as big ?
Was trying to compare your version to see how got it to the next level size.
With JavaScript Map, it remembers the order of the colors in the array.
Also used this with your version to make the carpet 7x7 = 49 squares
pxsz: integer = 3; // size of carpet's "pixel"
ptrnsz: Integer = 7; // size of carpet
UsedColorOrders: array of TColorArray;
Ptrn: TPatternArray = (
(0, 1, 2, 3, 2, 1, 0),
(1, 3, 4, 5, 4, 3, 1),
(2, 4, 5, 6, 5, 4, 2),
(3, 5, 6, 7, 6, 5, 3),
(2, 4, 5, 6, 5, 4, 2),
(1, 3, 4, 5, 4, 3, 1),
(0, 1, 2, 3, 2, 1, 0)
);
Clrs: TColorArray = (clBlue, clSkyBlue, clCream, clYellow, clRed, clMaroon, $CDEDA3, $2778D2);
Clrs2: TColorArray = ($C53F29, $DCB44B, $8A281E, $719AB7, $EDEDD3, $5778A2, $CDEDA3, $2778D2);
Not sure why you said: TList needed, or something that could be a recursively nested dynamic array as Seeds is a dynamic array created here: SetLength(seeds, Length(plttpatt)); ?