Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var count = 0;
- function cc(card) {
- // Only change code below this line
- var lowCards = [2, 3, 4, 5, 6];
- var highCards = [10, 'J', 'Q', 'K', 'A'];
- if (lowCards.includes(card)) {
- count++;
- } else if (highCards.includes(card)) {
- count--;
- }
- var action = count > 0 ? 'Bet' : 'Hold';
- return count + ' ' + action;
- // Only change code above this line
- }
- // Add/remove calls to test your function.
- // Note: Only the last will display
- cc(2); cc(3); cc(7); cc('K'); cc('A');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement