c2 and c3 are the same number but i want them to be different numbers. the reasons its the same random is because i want to keep track of whats being "drawn" and make sure the player cant draw the same card more than 4 times and draw more than 52 card.
> srand(time(0));
You should call this exactly ONCE at the start of main.
time(0) is going to be a constant in your short-lived program.
> int r1 = 0, r2 = 0, r3 = 0, r4 = 0, r5 = 0, r6 = 0, r7 = 0, r8 = 0, r9 = 0, r10 = 0, r11 = 0, r12 = 0, r13 = 0;
These are re-initialised to 0 every time you call the function.
If you want to remember where you got to, you should make them static.
Also, line 83 will NEVER happen, as it's after the return statement.
Dialing cards? Look here: http://www.cplusplus.com/forum/general/252307/#msg1110816
Lines 25 and 26. The trick is, the program "knows" which bit stands for what avers in which suit. An additional deck is just changing one constant.
Hint: Instead of riffle the cards I keep the deck in sorted order and pick cards at random. Not to pick that card a second time I mark it as already dialed out. Simple as can be.
You have 13 cards in order. You pick one in random. You put it back exactly where it was. You hope that you don't choose the same card multiple times. Stage magic does almost that in the "I know which card you saw" trick.
A dealer has a deck of cards.
The dealer shuffles the deck at start.
The dealer deals from the top of the deck and never puts any cards back.
When the deck is empty, it is empty.
Two very different procedures. Which one do you actually try to model?
To randomly choose things without repeat:
• create a list (array/vector/whatever) of things with no repeats
• randomize the list
• take the first item, then the second, and so on
For a deck of cards, you need a list of 1..52
Suite == card number / 13
Rank == card.number % 13