I'm developing a card game AI.
A player only knows it's cards and needs to randomly distribute the unseen cards to its opponents.
Some opponents will have 0% chance of having some cards (this is a must).
The opponents will be more likely to have some cards than others (this would be good but my main question is to solve the situation presented before).
Now the problem is that this card distribution must happen lots of times in a very short period of time, so randomly distributing it until the 0% chance cards are not in the hand of the opponents that have 0% chance of having them is not feasible.
What approach would you suggest if I want to solve this problems:
Make sure no opponent has a card that he has 0% chance of having while ensuring the other cards are evenly distributed (and one other opponent will have this card)
(In a situation where some players have 10%, 40%, etc.. chance of having a card)
Make sure the cards are distrubuted acording to their weights. Eg: A player has to choose 3 cards, he has 2% chance of having A, K or Q so he cannot only have thoose 3 cards to choose from (he may end up with n different highcards from different suits)
If you could help me to solve situation number 1 (in any language, or pointing me to an algorithm), I would realy apreciate it.
Thanks!
EDIT: I should clarify that while some opponents may have 0% chance of having one card other opponents may have a normal chance of having them (and someone definily will have to have it).
EDIT2: This means that if we keep distributing cards at will we may end up with only forbidden cards for the last player to take (which can't happen).