Time for a game… but first we'll need a deck of playing cards. Use deck-o-cards.js
as a starting point for this exercise.
- Make the function
deck_o_cards
assemble an array of cards using the provided suits and values arrays. Each card in the deck should be an object formatted as:
{suit: 'hearts', value: 'Ace'}
- Make
deck_o_cards
return a shuffled array of cards. - Call
deck_o_cards
, then print the following:
- "The deck has {n} cards"
- "The top card is the {value} of {suit}"
- Make a new array that pulls the top 5 cards and gives you a hand of poker!!
All content is licensed under a CCBYNCSA 4.0 license. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact legal@ga.co.