• Custom User Avatar

    Testing code is outright eldritch. Please do not monkey-patch user object to faciliate testing (a more functional user would freeze the prototype and cause your testing method to fail).

  • Custom User Avatar

    There are no limits to the possible values of troublemakersMaxHand: sometimes 100 is passed inside, which is absurd from the rules of the game.

  • Custom User Avatar

    (note: for simplicity the value should be decided when the ace is dealt)

    Player draws cards until the total is >= the player's max.

    This surpasses the realm of "unclear description" and reaches nonsensical realm (in relation to troublemakersMaxHand, which is also not mentioned anywhere).

    An ace do not have a fixed value until resolve time, so whatever this is (aces having a fixed value at dealing time) this would not be Blackjack anymore, as it introduces rules that deviates itself from the actual game.

    Also note that this is not "simpler"; you're making things more complicated and deviating from all known standards for no good reasons.

  • Custom User Avatar

    The complete flow of playGame is still not mentioned in the description (and only in a comment below).

  • Custom User Avatar

    Global obj object is created which can be overwritten by accident.

  • Custom User Avatar

    No random tests.

  • Default User Avatar

    deck class should start with capital letter.

    for simplicity the value should be decided when the ace is dealt

    If anything, it makes it harder to calculate score this way. I suggest adding score recalculation on every draw.

    you should deal one card to the dealer's hand and keep one elsewhere

    This line makes sense in practise, but not for this kata. It's not tested anywhere and there's no reason to do this. The line should be removed altogether, imo.