FreeCodeCampChina / freecodecamp.cn

FCC China open source codebase and curriculum. Learn to code and help nonprofits.

Home Page:https://fcc.asia/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Don't know where is wrong ...

dadafawang opened this issue · comments

commented

var count = 0;
function cc(card) {
// 请把你的代码写在这条注释以下
switch(card){
case 2:
case 3:
case 4:
case 5:
case 6:
count++;
break;
case 10:
case "J":
case "Q":
case "K":
case "A":
count--;
break;
default:
count=0;
}
if(count>0){
return count+" Bet";
}else{
return count+" Hold";
}
// 请把你的代码写在这条注释以上
}
// 你可以在这里添加/删除 cc 方法的调用来测试结果
// 提示: 左边只会显示最后一次执行的返回值
cc(2); cc(3); cc(7); cc('K'); cc('A');

image

commented

delete
default:
count=0;
then it is OK !