Example: Dealing Cards

This example takes the playing card scenario three steps further; it creates four players, deals the cards, and gives each player a way to play a card. Figure 8-8 shows the application in action.

This program can shuffle cards and also create players, deal, and accept plays from each player.

Figure 8-8. This program can shuffle cards and also create players, deal, and accept plays from each player.

Here’s the procedure for creating this application, separated into sections. As fair warning, you’ll be using the Deck class again.

Creating the Main Form

Follow these steps to create the main form for this example:

  1. In Visual Studio .NET, create a new Windows Application project named deal.

  2. In Windows Explorer, copy the Deck.vb ...

Get Faster Smarter Beginning Programming 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.