How do I Compare 2 array

Get help using Construct 2

Post » Fri Oct 24, 2014 8:34 am

Hello

i search but dont find what i looking for
anyone can help me, i'm confuse

how to compare each array

for ex.

arrayA = [0,1,2,3,4,5]
arrayB = [1,2,2,3,3,5]

i want to check how many same number at certain position so like :

for(i=1 i <array.length-1)
if( arrayA[i]==arrayB[i])
{ correct++
}

some thing like that

i'm confuse using for each element

help please

thanks
B
11
S
4
G
1
Posts: 15
Reputation: 1,332

Post » Fri Oct 24, 2014 11:27 am

Like this:
compareArrays1.PNG


or this:
compareArrays2.PNG
You do not have the required permissions to view the files attached to this post.
B
55
S
29
G
19
Posts: 1,520
Reputation: 25,650

Post » Sun Oct 26, 2014 10:51 am

superb !

thanks a lot
B
11
S
4
G
1
Posts: 15
Reputation: 1,332


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests