O'Reilly logo

C++ Without Fear: A Beginner’s Guide That Makes You Feel Smart, Third Edition by Brian Overland

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

15. Object-Oriented Poker

Any hour of any day in Las Vegas, Nevada, you can hear them: the unending “ding-ding-ding!” sounds from what used to be “one-armed bandits,” but these days are more likely to be machines playing video poker.

Now—at no expense!—you can bring the excitement of this classic game to your own computer, thanks to C++. Basically, each round of the game is a hand of draw poker, followed by a payout at the end. (Sorry, but I’m not set up to take your money, even if it were legal to do so. You’ll have to be content with winning virtual dollars.)

Although it’s possible to write this program without object orientation, I’m going to use this chapter to further demonstrate some more object-oriented features: how to return an object ...

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