Ad
  • Custom User Avatar

    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?

  • Custom User Avatar

    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.

  • Custom User Avatar
    • description still mentions "1" and "A"

    Fixed for Python and Java description

    • actual and expected values are switched (it should beTest.assert_equals(actual, expected))

    I was not sure what was the correct order, Fixed

    • sample tests still include multiple "1"s (along with "A"s)

    Fixed in python and JS

    • it's not specified how to decide if an A is 10 or 1? e.g. A, A, A counts as 3? 13? 23? 33?

    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.

    • the "fixed aces" test doesn't make any sense: 3 times 21 As?! WTF?!

    Not really an issue, it's just an edge case to check if the code handles "A" correctly

    • A, Q, 10, A, 6: why would someone ask for more cards when he starts with a BJ?

    Fixed test modified to make more "real" plays

    • (the real question would rather be "is that a possible hand" => actually, the liimt should be 16 aces when the game is played with 4 decks, I believe?)

    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

  • Custom User Avatar

    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"

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Oops, I didn't notice I added a "1" to the card list, I already fixed that

    Regarding this

    Note: /workspace/java/src/BlackJackExampleTest.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    
    Note: /workspace/java/src/BlackJackTest.java uses or overrides a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    

    I don't really know how to remove that message.

  • Custom User Avatar

    My head is blowing up with this