Stuck with simple patching

Hello everybody,

My head is burning since hours, and the solution is probably simple:)

I just dont succed to make a simple patch that extract first conbination from a spread. Its hard to explain with words, and so easy with a patch, so please see file attached.

Thanks by advance for your precious help! I’m really stuck on this simple think… :(

first combination from list.v4p (13.5 kB)

Just to make it more clear, a more detailed patch with step by step explanation. And a screen shot so you dont have to open the patch.
Thanks again for your help.

first combination from list.v4p (24.0 kB)

I made few tries, it seems to return correct pairs.
This is the first thing that came to my mind, maybe there’s a better way…
I’ll be on it.

first combination from list_mod.v4p (20.1 kB)

Thanks a lot for your try and so fast reply!

But it doesnt works. (its still a better and quicker patch than mine)

For example, if you change the random list by putting the random seed input of randomize node to : 2
You will see that you eliminate the first solution with the sift node. From that kind of observation my brain starting to burn :)

Yes, my solution works only under certain conditions - I got this too late.
Main issue is that we need to do more loops in the same frame, which is not possible unless we use a plugin.
Anyway, I’m studying some c# docs, I hope to understand what I have to do to write a plugin for this - if I’ll ever be able.

Humm so here is one limit of spread… that probably something v50 will correct?
(I guess it would not be a limit if every node as bin size pin)

Its really nice to try to help me with a plugin, I really appreciate. I would love to do it myself but I’m far away from beeing able to make my own plugin:)

And if you dont find any solution, I’ll just do a dirty pach with raw of nodes. Like “getslice” the first combination, then filter the list, “getslice” the second solution etc… And I will do this 50 times so it could be ok for my application.

Thanks a lot for your help

Will there only be 1 digit numbers in the lists?

No it could be up to 20… But if I cant I’ll find another way…

Up to 20 digits or 20 different numbers?
If you have 20 different numbers, worst case is that you have 20 pairs of the same number. Then you could just have a chain of subpatches that pass on a list filtered for invalid pairs to the next that does the same and the just have 20 of those. In no way elegant, but it would work if you just have 20 different values in the list.

Sorry for this misunderstanding, I mean 20 différents numbers, (from 0 to 19). So 10 combination, so 10 subpatch. And yes this chain is what I wanted to say when I said :

But I would have love the elegant way :)

(And I will do it 50 times so I can make sure that I can extend this 10 combinations limit in case I need it for my project)


did a plugin. does it do what it should? (15.7 kB)

that’s it! that’s it! Thanks for sharing.

hmm not sure… as in rogerlettes example the rule seems to a bit different as allready used values suddenly get used again under certain conditions. dont really get the logic here…

Tested against a lot of combinations.
rogerlette would feed it with a number of pairs, where each pair has always two different values. And your plugin returns always the valid pairs, where a valid pair is a pair that does not contain any value contained in other pair, - from first pair to last pair.
Post a patch using your plugin inside rogerlette example or indicate which seed number for randomize would return such a repetition. :)

I test many stuff, even out of my field of use, and it seems to be just perfect!

I dont know what could be wrong? I dont see what you mean by :

Thanks a lot!!!
It is much nicer and flexible than copy and paste subpatches.

hmm in your example, values allready apeared in previous slices still make it into valid combinations.

see my example picture… 1-8 is a valid combination even the 8 allready apeared in a previous slice. my example would ignore 1-8 in this case.

what are the exact conditions to pass as a valid combination?

just tested… and it works as in your example :D

didnt undestood my own stuff… but now its clear to me…

That’s fun!

I was actually looking at your plugin as it is a good example for me to learn how to do one myself.

And no, your code does not put the 8 in the “usedlist” because on the other side of the OR operation “usedlist” contain 9 so the code go to the next slice… Just perfect.

But of course, you quickly found this as mentionned in your last post, and you dont need me to explain this!

edit : looking at the time of the post, it took you less than 10min to test and find it, it took me 30min:)

tonfilm and i were patching breaking our heads around this. trying to find a way without plugin or framedelay…

i’ll pay anyone who finds an easy solution which does that for how matter how many indices a huge drink at node!