O'Reilly logo

Joy of Patterns: Using Patterns for Enterprise Development, The by Brandon Goldfedder

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

stddisp.cpp

 #include <iostream.h> #include "stddisp.h" #include "dealer.h" #include <ctype.h> // for tolower ostream& operator<<(ostream& s, const Card& card) { s << card.CardType() << card.SuitAsChar(); return s; } istream& operator>>(istream& s, BlackJackHand::TURN_RESULT& result) { char c = '\0'; while (c != 'h' && c != 's' && c != 'd') s >> c; switch (c) { case 'h': result = BlackJackHand::HIT; break; case 'd': result = BlackJackHand::DOUBLE_DOWN; break; case 's': result = BlackJackHand::STAND; break; case 'p': result = BlackJackHand::SPLIT; break; default: throw "Undefined!"; } return s; } ostream& operator<<(ostream& s, const BlackJackHand::TURN_RESULT& result) { switch (result) { case BlackJackHand::HIT: s << "HIT"; break; case BlackJackHand::BUST: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required