Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

counting Cards Bug #631

Open
dnan04 opened this issue Jul 11, 2019 · 0 comments
Open

counting Cards Bug #631

dnan04 opened this issue Jul 11, 2019 · 0 comments

Comments

@dnan04
Copy link

dnan04 commented Jul 11, 2019

Challenge Counting Cards has an issue.
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

var count = 0;

function cc(card) {
  // 请把你的代码写在这条注释以下
  
  if (card==2||card==3||card==4||card==5||card==6){
    count++;
  }else if(card==10||card=='J'||card=='Q'||card=='K'||card=='A'){
    return count--;
  }
  
  if (count>0) {
    return count+" Bet";
  }else {
    return count+" Hold";
  }
  
  // 请把你的代码写在这条注释以上
}

// 你可以在这里添加/删除 cc 方法的调用来测试结果
// 提示: 左边只会显示最后一次执行的返回值
cc(7); cc(8); cc(9); cc(2); cc('A');

the last cc() can't write 10 or 'J' or 'Q' or 'K' or'A',it does't change the value, others can be executed normally

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant