list transformation struggle
For some reason I can't quite seem to figure this one out. I have an 8 integer list, only 0's or 1's. I would like to transform that list based on the following rule:
For every 0, the new list should have x 0's and y 1's (e.g. if x = 2 and y = 3, then list 00110011 becomes 00001111110000111111)
I can of course iter through the list, but transforming each element and adding to a new list is causing me headaches, in particular when trying to add multiple 0's. Any help greatly appreciated!
Max Patch
Copy patch and select New From Clipboard in Max.
I am not sure about the regexp but it seems to work
Very cool solution, thank you!