|
OK, I want to know how would be a script describing the opposite variables list like this example:
and with this information that says the list of numbers is the number 5 and the useful variable are 3 and 4 I want to be able to know the opposite of the useful variable. In this case it would end something like this.
So what I want to know is how can I find the opposite of this variables. Note: I am trying to do this to have like it says 1 and 2 so if you press 1 and 2 is correct but if you press 1,2 and 3 is wrong. Thanks... for future :P
(comments are locked)
|
|
I'd use C# generic Lists ...
... and you know how to do this for java script?
Feb 04 '11 at 01:04 AM
Uriel_96
Not sure, I'm a C# guy :-). If you can't use generics then this may just work by using System.Collections and removing the "" bits, then tidying up the syntax for javascript. Syntax info available in this answer ... http://answers.unity3d.com/questions/5507/what-are-the-syntax-differences-in-c-and-javascript
Feb 04 '11 at 01:19 AM
yoyo
sorry, I really try it and it does not work maybe because I was expecting another thing. I was asking for a way to find the variables you don't need and add it to the variable, I wasn't planning to use Hashtable methods:(, but thanks maybe this will help to much people but not for me. :P
Feb 04 '11 at 02:31 AM
Uriel_96
yoyo's example code does exactly what you asked for. Is there any particular reason it doesn't meet your needs?
Feb 04 '11 at 02:48 AM
Jesse Anders
well maybe you haven't seen the note that I put in the question, that is actually what I am trying to do.
Feb 04 '11 at 03:51 AM
Uriel_96
(comments are locked)
|

Which type of array are you using, Built-in or other? C# or JS?
javascript, it says in the tags :P
He didn't just ask what language you're using; he also asked what type of container you're using.