I used a 2D array of booleans tracking which cards had been dealt. Then I ran a loop:
while(true)
{
Randomly choose a suit and face value
If it hasn't been dealt already, mark it as dealt and return a card with those characteristics
}
EDIT: The above was the deck's "deal card" method. To reshuffle the deck, merely reinitialize the array of booleans.
while(true)
{
Randomly choose a suit and face value
If it hasn't been dealt already, mark it as dealt and return a card with those characteristics
}
EDIT: The above was the deck's "deal card" method. To reshuffle the deck, merely reinitialize the array of booleans.