Howdy Y'all, I'm here again asking for some wisdom.
What I'm trying trying to achieve is make several instances of a object. Then limit how many of that type of object there can be. So for example, lets say I spawn five objects, in three seperate rows and assign a random color to each (red,blue,yellow). I want to make it that there can never be more than three of the same color. So, for example:
red, red, blue, yellow, yellow
yellow, blue, blue, red, blue
red, blue, red, yellow, yellow
so in the above, I know there are 5 of each color and want it so that no matter how many times I run the code, there will always be 5 just in different spots.
I attached a capx and have tried adding to a global variable but that didn't work out and for each is not exactly doing it. Any help would be greatly appreciated.
app.box.com/s/b0n9w15me7iulddtlaisox90ed10v44v