Skip to content

C++ card deck simulator with shuffling and dealing mechanics

Notifications You must be signed in to change notification settings

BorkedFork/cst120-intro-c-hw5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Card Deck Simulator

A C++ console application simulating a standard 52-card deck with shuffling and dealing capabilities.

Description

This program implements a complete playing card deck system using structs and arrays. It demonstrates card deck initialization, random shuffling algorithms, and card dealing mechanics commonly used in card games.

Features

  • 52-Card Deck: Full implementation of standard playing card deck
  • Four Suits: Hearts, Diamonds, Spades, and Clubs
  • Shuffling Algorithm: Random card redistribution
  • Card Dealing: Deals specified number of cards (default: 3-card hand)
  • Struct-based Design: Object-oriented approach using structs
  • Constructor Initialization: Automatic deck loading and shuffling
  • Random Number Generation: Time-seeded randomization

Technologies Used

  • C++ (mixing C and C++ features)
  • <stdio.h> for I/O
  • <string.h> for string operations
  • <time.h> for random seed
  • <stdlib.h> for rand()
  • Struct with constructor
  • Preprocessor constants
  • Visual Studio project structure

Card Representation

Cards are represented using integer codes:

  • Hearts: 100-112
  • Diamonds: 200-212
  • Spades: 300-312
  • Clubs: 400-412

Building and Running

Prerequisites

  • C++ compiler (Visual Studio recommended)
  • Windows operating system

Build Instructions

  1. Open the solution file in Visual Studio
  2. Build the solution (F7 or Build > Build Solution)
  3. Run the executable or press F5

Author

Christian Burnett

About

C++ card deck simulator with shuffling and dealing mechanics

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages