This lab assumes familiarity with the rules of Blackjack. The Wizard of Odds Blackjack Rules are accurate. Doubling and splitting are excluded from the initial lab. They are present as extensions. Insurance is not part of the lab.
All of the test code uses JUnit 5. See Running JUnit 5 tests.
BlackjackCard
class
BlackjackCard.java contains both completed methods and methods that need to be completed as part of this lab. The methods that need to be completed are marked with // TODO implement
comments. All methods have Javadoc.
See BlackjackCard class for additional explanation, hints, and solution code.
BlackjackHand
class
See BlackjackHand class for additional explanation, hints, and solution code.
Blackjack
class - part 1
Blackjack
part 1 involves writing the methods in Blackjack.java labeled // TODO implement (part 1)
.
See Blackjack class - part 1 for explanations of Shoe
, Blackjack
, and TestShoe
, hints, and solution code.
Blackjack
class - part 2
Blackjack
part 2 uses the same Blackjack.java file as part 1 and involves writing the methods labeled // TODO implement (part 2)
.
BlackjackCompleteTester
requires the use of TestShoe
just like BlackjackInitialTester
.
See Blackjack class - part 2 for additional explanation, hints, and solution code.
BlackjackUI
class
Both tests require the use of TestShoe
, just like the earlier testers.
See BlackjackUI class for additional explanation, hints, and solution code.
Comments
I’m particularly interested in improvements to the test code. Specifically, are there mistakes that the test code doesn’t catch?