The table function takes a variable amount of entries as its arguments, which are then laid out row by row. To pass the data as a list of tuples (like you currently do), you can use the flatten method to convert that list to a one-dimensional array, where the tuple structure is removed.
Now, since the table function does not take an array as its argument, but a variable amount of values (as in #table(first, second, third, ...), you can use the spreading operator.., which spreads the contents of the array into the arguments of a function call.
The moves argument of the mainline function is of type arguments, which can contain both named and positional arguments. As we only care about the positional ones, you can use the pos function to get them as an array.
In total, you only need to add a very small piece to what you already have:
I also removed a bit of nesting to avoid unnecessary swapping between content mode and code mode. This doesn’t mean that there was anything wrong with it, it’s mostly just personal preference.
(an array of all parameters: there was only one parameter, and that parameter is an array containing arrays of two moves each) – since flatten() gets rid of arrays recursively, this extra layer made no difference for the table.
I suggest additionally doing one of two changes:
instead of ..moves, write moves so that the single parameter (still an array) is processed directly.
instead of passing an array of arrays, directly pass multiple arrays of moves:
Hi @Friedrich_Kirch, don’t forget to tick one of the responses if you got a satisfying answer. The answer you choose should usually be the response that you found most correct/helpful/comprehensive for the question you asked.