Check if 4 values are unique to each other

Get help using Construct 2

Post » Mon Jul 02, 2012 10:57 pm

Hello,

Does anyone know a quick way to take 4 variables, or even an array of 4 values and tell if each item is unique?

Thanks!
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,637

Post » Mon Jul 02, 2012 11:10 pm

Well, you could take an empty dictionary and add a key for each value.
aka the "key" would be the value and the "key's value" can be say 0. Then add a condition to see if "Dictionary.KeyCount=4". If it's not then the values are not unique.
B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Tue Jul 03, 2012 4:32 am

What if i'm dealing with strings?

String1 = "Apple";
String2 = "Apple";
String3 = "Corn";
String4 = "Corn";

CompareStrings(String1,String2,String3,String4);

if ( CompareStrings() == true )
{
//Strings are unique
}
else
{
//Strings are not unique
}

I'm wondering if find(src, text) might be a possibility.

Let me know if you have any ideas
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,637

Post » Tue Jul 03, 2012 5:52 am

B
79
S
24
G
54
Posts: 4,749
Reputation: 40,761

Post » Tue Jul 03, 2012 7:14 am

Thanks man, I really appreciate it
Epic Space Online - Google it!
B
34
S
10
G
5
Posts: 165
Reputation: 6,637


Return to How do I....?

Who is online

Users browsing this forum: Justin1967, qaisarehman, Yahoo [Bot] and 31 guests