Ad
  • Default User Avatar

    You are showing ['A', 'A', '7', '7', 'K'] as the hand for the croupier, but the croupier should always only start than 2 cards. If the croupier is starting with more than 2 cards, then I agree that the test case is incorrect, however if you added the two '7's and the 'K' yourself, then that is a mistake on your part.

    Assuming that the croupier starts with ['A', 'A'], this would add up to 22 if both are valued at 11, so in this case, one of the 'A's would have a value of 1, and the other would have a value of 11, for a total of 12. After this, the croupier would draw the first '7', which would bring their score to 19. Since 19 >= 17, the croupier does not draw any additional cards, and their score is higher than player 1's score of 18, so player 1 loses. Player 2 and player 3 both have scores over 21, so neither of them win either.

  • Default User Avatar

    In the case above, only player1 has black jack. Black Jack means only two cards, one being an ace ('A'), and the other any card that is worth 10 points. In the case above, the croupier starts with an '8' and a '2', adding to 10, so they will draw another card and get an ace ('A'), which makes their total score 21. Even though they have 21, they got there with 3 cards, not 2, so it is not considered Black Jack.

  • Default User Avatar

    I'm not sure if the rules have been updated since you wrote this, but they are currently in the description. They are as follows:

    1. If a player has blackjack (meaning only two cards, one an "A" and the other a card worth 10 points) and the dealer does not, then the player wins.
    2. If the player's score is less than or equal to 21, but greater than the dealer's score, then the player wins.
    3. If the player's score is less than or equal to 21, and the dealer's score is greater than 21, then the player wins.

    In all other cases, the game is either a draw, or the dealer wins. For the purposes of this Kata, a loss and a draw are treated the same way, and you are only concerned with wins. To be more specific about losing and drawing conditions:

    1. If a player's score is greater than 21, they lose, regardless of the dealer's score.
    2. If both the dealer and the player have blackjack, it is a draw.
    3. If the dealer's score is greater than or equal to the player's score, and both scores are less than or equal to 21, but neither the player nor the dealer have black jack, then it is either a draw if the scores are the same, or the dealer wins if the dealer's score is greater.

    Hope that helps!

  • Custom User Avatar

    Megamind has to shoot 3 times doing 4 hp damage each time. Read the example in the description.