Chapter 27:Creating Two Card Programs
In Chapter 16, Creating and Using More Complex Structures, we modeled a set of cards as complex structures and implemented some basic actions done with cards. The actions were implemented as functions that operated upon the complex structures. That chapter ended with a program that dealt out fours from the deck of cards and printed the result. This would have been the beginning of a complete card game, say whist, gin, or even bridge. However, far more game logic would be required and many complex problems would need to be solved (one such problem might be playing such a game over a network with each player on their own computer) to make a complete application.
Since we are learning C and are not game programmers per se, we stopped short of developing any such card games. Instead, we’ve reused the dealer.c
program to expand our knowledge of C features, such as working with multiple files in Chapter 24, Working with Multi-File Programs...