Chapter 16. Blackjack Iteration 2: Adding Rules

Yesterday you performed the initial analysis and design of a Blackjack game. Today you will continue that process and add additional rules to the Blackjack game.

Today you will learn how to

  • Model the Blackjack game states

  • Use states to remove conditional logic

Blackjack Rules

Yesterday you built a simple Blackjack game. The game that you designed and built dealt cards and allowed a player to play until he either stood or busted. A real Blackjack game will do a bit more. In a real Blackjack game, aces are worth 1 or 11 points. Players can get blackjack, bust, standoff, lose, or win. A dealer won’t even play if all of the players bust or he is dealt a blackjack hand.

Today you will add the necessary logic ...

Get Sams Teach Yourself Object Oriented Programming in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.