Skip to content

Intermediate C# Programming: Card Games Introduction

Project Overview

We will be building three card games. The first two will give you the skills needed to build the third. The components created will allow you to add more games later.

This is an intermediate project. If you are just starting out with C#, work through the C# Adventure Game to learn the language and fundamentals of object-oriented programming.

Screenshot of card game application.

Card Games

There are many different types of card games (such as matching and collecting cards). Even though they might be classified as different types, they still have similarities. For example, they all use multiple cards, they all have players, and they all have one or more win conditions.

Identifying these commonalities will help you in creating a modular framework. Although the games themselves may be different, the code will be shared. You will write less redundant code, and learn more about how object-oriented programming works.

Card Game Patterns

A photograph of a deck of cards split into a draw pile and a discard pile.

What are some of the patterns card games share? Review these games and make notes about the patterns you see.

Card Game Questions

A photograph of a hand of cards.

How will the card game classes be designed? These questions can help:

  • Do all card games have one single deck?
  • Looking across a variety of card games, do players always have a hand of cards?
  • What are the properties of a card game?
  • What are the actions (verbs) that occur during a card game?

Card Properties

What are the defining properties of a card? In other words, how do you know something is a card when you see it? Listing the properties will help you in creating a card class for the project.

  • What makes a card identifiable as a playing card?
  • What are the possible values a playing card might have?
  • Does the value of a card ever change between games, or within a game?

To Do

Assignments

This is an important step. In identifying patterns for card games, and for a card itself, you are defining how fundamental parts of the application could be built.

  1. List the patterns you see across several card games.
  2. List the properties of a single card.

Next Step

To be continued August 2023!