jwade21 / deck_of_cards

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

License:Other


Languages

Language:JavaScript 100.0%