< Back to IRCAM Forum

Extract lists from a list

Hello there,

I´m trying to extract lists from a list.

Example:

I have (1 2 3 4 5 6)
I need ((1 2) (2 3) (3 4) (4 5) (5 6))
and ((1 2 3) (2 3 4) (3 4 5) (4 5 6))
and ((1 2 3 4) (2 3 4 5) (3 4 5 6))
and so on

Can someone help me?

Thanks

Andrés

Dear Andres,
Here you go my friend.

the patch:
Patch 19.omp (7.3 KB)

Best
K

Thanks a lot. It is very helpful

best regards

Andrés

Hi Andres,

Here are 2 diff ways, everything but elegant, just for recreational purposes :slight_smile:

(i don’t know which one is worst lol)

best, rc

Great, thanks a lot, it works very nice