This assignment focuses on providing alternative methods to shuffling a basic deck. The first method was done similar to how I handled tournament seeding for an internship, whereas the second one goes for a more random (and a bit naive) way of shuffling a card. Both of these methods do shuffle the deck, so I am perfectly fine with the results. Both of these methods start by generating a sorted deck of cards.
For this method, I have decided to randomly grab a card from the sorted deck and insert it to the new deck. I used the splice method to remove an element from the original deck, and then inserted into the new deck until the original deck is empty.
Using one deck, I would go through each card and swap that card with a random card that isn't the card we intend to swap it with. I personally like this method more, as I am not using the splice method, and there's more flexibility to make expand the way this can be shuffled more efficiently (does not swap with positions it already has swapped with || can swap with itself || merge sort but make instead of sorting randomize each value).
Click on one of the buttons to show the shuffling