Coding a More Functional Poker Game
In Chapter 6 we experimented with coding the game of poker and were able to put together a very simplistic version of the game. The advanced program in this chapter builds on the earlier code for generating nonduplicate numbers to represent the cards in a playing deck. It deals five random cards to the player and five to the dealer (refer to Table 6-1 for card value translations). The code in Listing 9-1 goes on to identify both hands by using the rules of poker. At first glance, it looks like a tremendous amount of code, but because the player and dealer sections ...