Please help with the sloution. thanks in advance

Tell us what’s happening:
Describe your issue in detail here.

   **Your code so far**

var count = 0;

function cc(card) {
 // Only change code below this line
  switch(card) {
  case 2:
  case 3:
  case 4:
  case 5:
  case 6:
  return "5 Bet";
  case 7:
  case 8:
  case 9:
  return "0 Hold";
  case 10:
  case "J":
  case "Q":
  case" K":
  case "A":
  return "-5 Hold";

 // Only change code above this line


 return "Change Me";
 // Only change code above this line

cc(2); cc(3); cc(7); cc('K'); cc('A');
   **Your browser information:**

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36

Challenge: Counting Cards

Link to the challenge:

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

Learning to describe problems is an important part of learning how to code.

Also, the more information you give us, the more likely we are to be able to help.

Hey Fabulous,

Your algorithm should have two parts:

(1) Calculate the new value of your “counter” in the switch block of your code.

(2) Find out if the new counter value is negative or positive and return a String that contains the counter and either “Hold” or “Bet”.

I think you misunderstood the task a bit because you return some fixed values such as “0 Hold” in the switch block.


1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.