Counting Cards(Not Working)
See original GitHub issueChallenge Counting Cards has an issue.
User Agent is: Mozilla/5.0 (Windows NT 5.1; rv:44.0) Gecko/20100101 Firefox/44.0
.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
var count = 0;
function cc(card) {
// Only change code below this line
switch (card) {
case 'J':
case 'Q':
case 'K':
case 'A':
case 10:
count--;
}
if (count < 7) {
count++;
}
if (count <= 0) {
return count + " Hold";
}else if (count > 0) {
return count + " Bet";
}
return "Change Me";
// Only change code above this line
}
// Add/remove calls to test your function.
// Note: Only the last will display
cc(3); cc(9); cc('Q'); cc(8); cc('A');
It looks to me like this code works. Several users in the chat said this should work. But, I keep on getting it wrong. I believe this is a bug,
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Counting Cards At The Casino - Why It Doesn't Work Anymore
This means that after just a few hands, when you've been counting cards, they will ask you to stop and leave the premises...
Read more >If counting cards in blackjack is so effective, why isn't ... - Quora
A basic count is not that effective. Professionals utilise knowledge of the fact that casino shuffles are not perfect, and have devised systems...
Read more >Counting Cards not working Feb.7th 2022 - JavaScript
I know I can try with Switch but idk why my if statement is failing **Your code so far** let count = 0;...
Read more >4 Reasons Why Counting Cards is a Waste of Time
One main reason why card counting is a waste of time is that as soon as a player gets a good read on...
Read more >Does Card Counting Work and Other Blackjack Misconceptions
The pros at Blackjack Apprenticeship answer the age old question, "Does Card Counting Work?" Does counting cards work? Of course it does!
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Content Hidden - by mod [raisedadead]
Nope, not a bug. Hint, here’s your problem:
Just one thing here needs to change and your code will pass. If you compare this
if
statement with yourswitch
statement you’ll see what’s wrong.