Guest User

Untitled

a guest
Oct 20th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. this.dealCard = function () {
  2. this.dealedHand.push(shuffledDeck.shift())
  3. let sum = 0
  4. this.dealedHand.forEach(function (card) {
  5. if (card.value === 1 && sum <= 7) {
  6. card.value = 14
  7. } //Another condition clause to reverse that and let the ACE be 1 again...
  8. sum = sum + card.value
  9. })
  10. this.dealedHandSum = sum
  11. }
  12.  
  13. Johanna: A♠ K♣ 27
  14. Johanna got 27 and is busted!
Add Comment
Please, Sign In to add comment