Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- this.dealCard = function () {
- this.dealedHand.push(shuffledDeck.shift())
- let sum = 0
- this.dealedHand.forEach(function (card) {
- if (card.value === 1 && sum <= 7) {
- card.value = 14
- } //Another condition clause to reverse that and let the ACE be 1 again...
- sum = sum + card.value
- })
- this.dealedHandSum = sum
- }
- Johanna: A♠ K♣ 27
- Johanna got 27 and is busted!
Add Comment
Please, Sign In to add comment