Skip to content

generalassembly-atx/deck_of_cards

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Deck o' Cards

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.

  1. 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'}
  1. Make deck_o_cards return a shuffled array of cards.
  2. Call deck_o_cards, then print the following:
  • "The deck has {n} cards"
  • "The top card is the {value} of {suit}"

Bonus

  • Make a new array that pulls the top 5 cards and gives you a hand of poker!!

Licensing

All content is licensed under a CC­BY­NC­SA 4.0 license. All software code is licensed under GNU GPLv3. For commercial use or alternative licensing, please contact legal@ga.co.

Releases

No releases published

Packages

No packages published