Deck Shuffling

Implemented a deck shuffling algorithm. It will iterate over the deck of
cards 1000 times and swap the card it is on with another random card to
mix up the deck.

Reviewed-on: #12
This commit was merged in pull request #12.
This commit is contained in:
2026-01-10 20:09:53 -05:00
parent cedef1792f
commit b5cc0a7293
4 changed files with 160 additions and 1 deletions

View File

@@ -5,6 +5,7 @@ fn check_num_decks() {
let mut num_card: [u64; 52] = [0; 52];
let num_decks = 8;
let mut deck = Deck::new(num_decks as u64);
deck.shuffle();
for _ in 0..deck.deck_size() {
let next_card = deck.get_next_card();