Created
May 1, 2016 09:21
-
-
Save zhangolve/9cf8c8ef9664fd3300b3ace17cb8019e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var count = 0; | |
function cc(card) { | |
// Only change code below this line | |
function compare(count){ | |
if(count>0) | |
{ | |
return count+" Bet"; | |
} | |
if(count===0) | |
{ | |
return count+" Hold"; | |
} | |
if(count<0) | |
{ | |
return count+" Hold"; | |
} | |
} | |
if(card>1&&card<7){ | |
count+=1; | |
return compare(count); | |
} | |
if(card>6&&card<10){ | |
return compare(count); | |
} | |
if(card==10||card=='J'||card=='Q'||card=='K'||card=='A'){ | |
count-=1; | |
return compare(count); | |
} | |
} | |
// Only change code above this line | |
// Add/remove calls to test your function. | |
// Note: Only the last will display | |
cc(10); | |
cc('J'); cc('Q');cc('K'); cc('A'); | |
//cc(2); cc(3); cc(4); cc(5); cc(6); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
嵌套函数功能块。