Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I didn't have that problem but I think I know why it happened.
Could you try again to check if the problem has been solved?
It is a task of your code to figure out when it should count the Aces as 11 or 1
When choosing their values, the priority is that the sum is the closest to 21, without exceeding
Example
if the initial hand is
"A", "A" = 22
, with 22 points the player should lose, however, since "A" may also worth "1" the new value of the hand should be"A", "A" = 12
, 12 since one of the "A" worth 1, now let's suppose the player hit a new card(draw a card) and got a "10""A", "A", "10" = 22
, again, with 22 points the player should lose, but one of the Aces still worth 11, so it is changed to 1"A", "A", "10" = 12
, If the player hits again and get a "K""A", "A", "10", "K" = 22
, now the player lose since both "A" worth 1, but the player has over 21 points.Fixed for Python and Java description
I was not sure what was the correct order, Fixed
Fixed in python and JS
it is. " >"A" may worth 11 or 1, always trying to keep the highest score possible.< ", also there is a link with all the detailed rules.
Not really an issue, it's just an edge case to check if the code handles "A" correctly
Fixed test modified to make more "real" plays
Well, there's not really a Rule that says how many decks should be used, some casinos just use 1 deck, other uses 4 decks, some even 8 decks
That was a Mistake that I already fixed, there should be an
"A"
, not an"1"
I corrected it a few hours ago, so I do not know why it has appeared to you with a
"1"
This comment is hidden because it contains spoiler information about the solution
Oops, I didn't notice I added a "1" to the card list, I already fixed that
Regarding this
I don't really know how to remove that message.
My head is blowing up with this