Path compare mismatch?

Path Compare.gh (13.7 KB)
Hi there,
I wonder how are these components not working as what I think with those red pen selected to be true.
Is there anything misunderstanding with these components.
And how could I do to match what I want?
Thanks,
regards,

if you plug lists of different length, they are usually interpreted as if the last element of the shortest list is repeated until the length of the initially_shorter list becomes equal to the longer one:

this also explains why the element at index 13 being True looks kind of weird

by the way, as your tree has no branches, the comparison is done index-by-index from list a to list b
so it will result True only if item at index x of list A is equal to the same item at index x of list B

2 Likes

If you use Longest List, then you’ll understand what @inno 's said.

1 Like

Thank you both for those clear explanations.
I found the solution done by a further comparison.
Not that convenient, but working !

Here is a Python option:

a = [i in p2 for i in p1]

Path Compare_v2.gh (11.5 KB)

2 Likes

Thank you, Adam,
I’m just currently learning how to code,
and definitely will get to know it.
but never thought it will be this ease! :sweat_smile:
Cheers!

1 Like

Here’s another way…


Path Compare_re.gh (10.3 KB)

3 Likes

If not restricted by the rule of seeking the easiest and the fastest approach only,
it’s still funny to scout any possible solutions within those limited components,
thanks for sharing the good-skill again! :grinning:

TreeSloth has a couple helpful tree matching components

2 Likes

Using graft + mass addition is another useful technique for determining if the values in one list are contained in another

3 Likes