How do I find a coincidance between two ranges of an array?

0 favourites
  • 5 posts
From the Asset Store
This is a Dungeon Master tool & the 1st of 12 Combat Engines from the Building Combat Engines for Browser Games workshop
  • Hello, fellas!

    Sorry in advance for a dumb question, but for me it is a real stumbling block. Ok, cut to the chase. I have to compare two ranges of an array and find a single coincidance.

    For example (take a look at the attached image), I want to compare column X2, Y6 with column X4,Y6. The only common value between them is number 1.

    - How do I find the coinsidance?

    - How to store that common value (number 1 in this precise case) to a variable?

    Thank you in advance.

    Tagged:

  • Does the coincidence can be any same number or specified before hand?

  • Does the coincidence can be any same number or specified before hand?

    The logic is like in the 'Dobble' game ('Spot It' in the US).

    You have two cards with six images on each of them. One and only one image is unique shared by two cards.

    The question is, how do I find that unique entity and store it to a variable afterwards.

  • Well you need to compare them in loop through index length. First index of "A" list compared to loop index of "B" list. If same value is found then stop iterate otherwise continue to second index of "A" list and repeat. Kind of that logic.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • alextro thanks a lot for your advice. Really appreciate your readiness to help! The task has been resolved successfully :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)