IamFace
04-15-2009, 08:49 PM
Hey all,
I'm wondering if anyone knows how to check an array to see if it includes a number of items, but in no specific order?
I'm building a game, where depending on the scenario, you drag specific items to an area of the stage. At first I was simply adding each item dragged into an array, then at the end checking to see if that array matched one I had previously created (to see if they were in the correct order).
Everything works great, until the client decided they wanted them in any order, as long as they are all in there.
For example:
You need to drag item1, item2, and item3. The array does not have to be [item1, item2, item3], it can be in any order, like [item3, item1, item2], whatever. I need to check to see if all the items are included. Is there a way to do this? I've never seen if so and would like to learn :)
Thanks!
I'm wondering if anyone knows how to check an array to see if it includes a number of items, but in no specific order?
I'm building a game, where depending on the scenario, you drag specific items to an area of the stage. At first I was simply adding each item dragged into an array, then at the end checking to see if that array matched one I had previously created (to see if they were in the correct order).
Everything works great, until the client decided they wanted them in any order, as long as they are all in there.
For example:
You need to drag item1, item2, and item3. The array does not have to be [item1, item2, item3], it can be in any order, like [item3, item1, item2], whatever. I need to check to see if all the items are included. Is there a way to do this? I've never seen if so and would like to learn :)
Thanks!