Ad
  • Custom User Avatar

    In JavaScript, in the test cases the dealer is not expected to win if both players have the same sum of cards.

    Log

    Dealer: Jason has the cards: 5, 5, 11
    Player: Jimmi has the cards: 10, 11
    The total sum of Dealer Jason's cards are 21
    The total sum of Player Jimmi's cards are 21
    Expected: 'Jimmi', instead got: 'Jason'

    Log

    Dealer: Frank has the cards: 5, 5, 11
    Player: Brandon has the cards: 10, 11
    The total sum of Dealer Frank's cards are 21
    The total sum of Player Brandon's cards are 21
    Expected: 'Brandon', instead got: 'Frank'

  • Custom User Avatar

    @LarisaOvchinnikova That was not true, I had valid responses and it was not accepting my responses, for now the issue seems to be resolved (with the same script).

  • Custom User Avatar

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

  • Custom User Avatar

    Probably bad practice to have a global variable lingering because of this, but it's still fun that you were able to get it on one line. :P

  • Custom User Avatar

    This is an awesome use case for Boolean! Awesome work!