Your First Windows CE Application
Writing a Windows CE program is much the same as writing any other Visual Basic program. However, you'll have to accustom yourself to many differences in the language and to the development environment. You'll need to carefully consider the structure of your code and the implementation of the finished application. I have written a card game named Pontoon, and I will use this application from time to time to highlight important points. Figure 5-8 shows some screen shots of the application.
Perhaps now might be a good time to explain quickly the rules of the game-it's similar to Blackjack, or 21. The player plays against the computer (dealer) with the aim of attaining a score of 21. If the score goes over 21, the game is lost. The player can choose to be dealt another card, ("twist"), and his or her score is calculated as a sum of the face values of all the player's cards. The ace has a face value of 11 and picture cards have a face value of 10. If the player decides that another card might bring his or her score over 21, he or she might decide to not take anymore cards ("stick"). After a player chooses to stick, all subsequent cards will be dealt to the dealer. If the dealer reaches a score higher than the player's and below 22, the dealer wins. But if the dealer's score exceeds 21, the dealer loses. Before the player makes the first twist he or she must select an amount to gamble. If the game is lost, the player's funds are deducted by that amount. If the player wins, his or her funds are increased by the amount gambled. That's it! The full source code for the Pontoon game is included on the CD-ROM accompanying this book.

Figure 5-8 The Pontoon Windows CE card game in action-I got lucky this time!