Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. var count = 0;
  2.  
  3. function cc(card) {
  4. // Only change code below this line
  5. var lowCards = [2, 3, 4, 5, 6];
  6. var highCards = [10, 'J', 'Q', 'K', 'A'];
  7.  
  8. if (lowCards.includes(card)) {
  9. count++;
  10. } else if (highCards.includes(card)) {
  11. count--;
  12. }
  13.  
  14. var action = count > 0 ? 'Bet' : 'Hold';
  15.  
  16. return count + ' ' + action;
  17. // Only change code above this line
  18. }
  19.  
  20. // Add/remove calls to test your function.
  21. // Note: Only the last will display
  22. cc(2); cc(3); cc(7); cc('K'); cc('A');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement