Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blackjack instructions say to split if 2 aces are received. #2311

Closed
sthavens opened this issue May 18, 2023 · 2 comments · Fixed by #2508
Closed

Blackjack instructions say to split if 2 aces are received. #2311

sthavens opened this issue May 18, 2023 · 2 comments · Fixed by #2508

Comments

@sthavens
Copy link

sthavens commented May 18, 2023

This requires either card1 and card2 to be passed into largeHand (or handscore). By passing isBlackjack, one obfuscates the cards and a "split" cannot be determined as it exists only where either a handscore of 22 or parsing of card1 and card2.

This is the particular test that should be failing for everyone if they code it correctly:

@Test
    public void firstTurnWithAceAceAndDealerAce () {
        assertThat(blackjack.firstTurn("ace", "ace", "ace")).isEqualTo("P");

This is the method stub in question:

public String largeHand(boolean isBlackjack, int dealerScore) {
        throw new UnsupportedOperationException("Please implement the Blackjack.largeHand method");
    }

The particular instruction:

Category: Large Hand

    If you have a pair of aces you must always split them.
    If you have a Blackjack (two cards that sum up to a value of 21), and the dealer does not have an ace, a figure or a ten then you automatically win. If the dealer does have any of those cards then you'll have to stand and wait for the reveal of the other card.

This can obviously be modified but this is an early track exercise so that should probably not be expected of what might be a 1st time programmer's 6th or 7th exercise on your site.

@sanderploegsma
Copy link
Contributor

I agree that the instruction for this exercise (as well as the stub implementation) is a bit clunky. I remember struggling to understand what I was meant to do myself.

However:

a "split" cannot be determined as it exists only where either a handscore of 22 or parsing of card1 and card2.

If you read the instructions carefully, it says (emphasis mine):

  1. Implement the decision logic for hand scores larger than 20 points.
    Implement a function that returns the string representation of a decision given your cards. This function is only called if the handScore is larger than 20. It will receive 2 arguments: isBlackJack and dealerScore. It should implement the bulletpoints in the category "Large Hand" above.

So that means that it will be called in two cases: when handScore == 21 (in this case isBlackjack == true) or when handScore == 22 (in this case isBlackJack == false)...

Again, I agree that this is far from intuitive and it's probably too complex for a student at this point in their learning journey.

@chrollorifat
Copy link
Contributor

Can't we simplify the instruction a bit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants