/PlayingCards-Shuffle-And-Deal

A simple Playing Card deck generator using Card objects. Includes Card shuffling and dealing the cards to 2, 3, or 4 players!

Primary LanguageJavaScript

PlayingCards-Shuffle-And-Deal

I created a Class of Card with properties: name, id, suit, value, color, and isFaceCard.

I then initialize each instance of Card and split them up into 4 different arrays sorted by suit.

I then put all of the objects into a single array of Card objects with all 52 cards inside(unsorted). I return this deck from the function

I create 2 different shuffling algorithms and I use both of them to shuffle the deck

After shuffling, I deal out the cards using a function where you can input how many players are in the game and the function will distribute them equally. Currently, the functionality only allows dealing cards out to two, three, or four players. Feel free to give me some advice on how I can improve this code. I know I could cut back on a lot but I am still learning.

Enjoy!