A simpler notation for this array example?

Dear advanced users,

I want to make the following array (Array 1) more compact:

/* Array 1 */
[[[\g3, \b, \e4], $(], [$|], [$\\], [$\\], [$\\], [$\\], [$\\], [$\\]]

However, the following way (Array 2) is not what I want because the first element of Array 1, i.e. [[\g3, \b, \e4], $(], is also modified:

/* Array 2 */
[[[[\g3, \b, \e4], $(]], [[$|]], [$\\]!6].flatten

Is there a simpler way to renotate Array 1 without touching its first element?

how about:

[[[\g3, \b, \e4], $(], [$|]] ++ [$\\].dup(6)

also when dealing with arrays of arrays there are some helpful ideas here:


1 Like

Thanks, this seems the only possibility!

To repeat the ending element, there’s also clipExtend.



Thank you! There is always more to learn!