Ad
  • Default User Avatar

    A player only wins with blackjack if the croupier does not also have blackjack. If everyone has blackjack, then the players all lose. The croupier is not considered a player, so you never return them in the list of winners.

  • 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!

  • Default User Avatar

    Though I agree that the description could be improved, it is not asking you to write code for the player behavior, just the dealer. In this scenario, the players have already drawn all of their cards, and you simply have to write code for a function that draws cards for the dealer until their total score is 17 or higher, and then returns a list of which players won according to the rules given.

  • Custom User Avatar

    While I enjoy the idea of this Kata the instructions are extremely unclear. There is a lot of considerations that need to be made to determine if a player should hit or not. This Kata does not help us outline the considerations that tell the players to hit or not to hit. Unless they are always supposed to hit until they achieve 21 but that seems kinda silly. The win conditions are also not outlined well and that causes a lot of confusion.

    In its current state I would avoid this kata which is a shame cause it does seem like it could be a fun one :/ please update this!

  • Default User Avatar

    Hey,

    this one is not working when tested against random tests. The example result from random test:
    Testing for 314 and "mago": expected 'That was close!' to equal 'Fire!'. However, I cannot find an issue on my own, someone please help? :)

  • Default User Avatar

    The description of this kata is poor. It does not state fully the winning conditions. A player wins if they have BJ and the croupier does not. But what about other cases? There is no information at all what to do with other situations, for instance if noone has BJ, or the croupier has more than 21 and players less than 21. Please update.

  • Default User Avatar

    ['A', '10', '3', '4'] ['6', 'K', '8', 'A', '8', '4', 'A', 'K'] ['10', '9', 'J', '2', 'Q', '7'] ['A', 'A', '7', '7', 'K'] ['J', '7', 'Q', '5', 'Q', 'J', '3', '9', '4', 'K', 'A', '7', '5', 'K', '9', '10', 'J', '8', '6', 'J']

    Similarly here. According to the random tests noone is winning. According to me, the first player has either 28 points or 18, so we go for 18 and she/he is winning. We go for 18 points (ace counting for 1) since according to the description we go always for more points. What am I missing?

  • Default User Avatar

    Test 21: ['J', 'A'] ['K', '10'] ['10', '2', 'Q'] ['8', '2'] ['A', 'J', '10', '2', 'A', '2', 'A', '3', '5']

    Why player 1 is considered a winner here? The croupier has a BJ so the players loses. What am I missing?

  • Custom User Avatar

    One does not need both min and max vars, when the arrays are sorted you just need to store the ceiling of the previously calculated interval

  • Custom User Avatar

    looks like it's not happening anymore. Poke at me on discord if you still see the problem

  • Custom User Avatar
  • Custom User Avatar

    no actionnable information, closing.

  • Custom User Avatar

    no actionnable feedback, closing

  • Loading more items...