This may be a little advanced for someone who is just starting out since what you're looking for is both procedural and involves avoidance, but it is definitely doable and will teach a lot if you go through with it.
Someone else may be able to come up with an easier solution, the following may be a good starting point.
1) Ditch the animator altogether.
Since you want to have a dynamic number of cups, the animator probably wouldn't work for you, at least not without lots of hacking.
2) Come up with an algorithm to decide on where the cups should go
You can consider the movement of the cups to be in steps. A complete shuffle may consist of n number of steps. In each step, you can do the following:
- Assuming you have 3 cups in total, you have 3 possible slots for the first cup.
- Pick a slot randomly, and store that as the target position for the cup.
- Move on to the next cup, and pick a slot randomly from the remaining slots.
- Continue until you have decided on a new position for each cup.
If you this step many times, you get a complete shuffle.
3) Avoidance
###3) Avoidance AtAt each of our steps, after each cup knows its new target position, we would have to actually move the cups to their target position. We should do this in code. However, if we move each cup directly to their target positions, the cups would start clipping through each other.
If you're mathematically inclined, you could go into complex calculations of parabolas to determine the path for each cup such that there are no collisions. This, however, is not easy. A much simpler approach would be to find a way for each cup to avoid all the other cups as if it were sentient. I like to use steering.
With all that done, all you have to do is to fill in the rest of the code that makes the game playable.
Keep in mind, this is not the only way to do it. There are plenty of ways to create the same feature when writing a game. So don't worry about the details, start messing around with it and try getting something to work. Best of luck!