Skip to content

This was my first big project for my C++ class, it's a simple Black Jack game, that lets you pick a number of players, their names, and the game will automatically deal cards and determine the winner.

License

Notifications You must be signed in to change notification settings

vs0t/Cpp-BlackJack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPP Blackjack Game

Description

CPP Blackjack is a console-based simulation of the classic Blackjack card game. It allows users to simulate multiple players in a game, each trying to achieve the best possible hand without exceeding a score of 21. This project was developed as part of an exam submission, showcasing object-oriented programming principles and the use of C++ for game development.

Features

  • Simulate multiple players in a game.
  • Automatic calculation of hand values, including handling of Aces as 1 or 11.
  • Automatic decision-making for drawing additional cards.
  • Evaluation of player scores to determine winners, ties, and busts.
  • Manual inclusion of GoogleTest in the build directory due to linking issues.

Installation

To compile and run the project, you will need g++, cmake, and googletest installed. Note that GoogleTest was manually downloaded and included in the build/_deps directory due to issues with linking. I removed the build folder for my online upload of this, if you would like to run my project the way I currently have it programmed, contact me or create an issue for the correct build folder to run this program. Follow these steps to set up the project:

  1. Clone the repository to your local machine.
  2. Open a terminal in the root directory of the project.
  3. Create a build directory: mkdir build
  4. Run CMake to configure the project: cmake -S . -B build
  5. Compile the project: cmake --build build

The compiled binaries will be located in the build/app and build/tests directories.

Usage

To run the game simulation, execute the following command from the terminal:

./build/app/blackjack

To run the unit tests, execute:

./build/tests/blackjacktests

Project Structure

  • app/: Contains the main game application code.
  • inc/: Header files for the project, defining the Card, Deck, and Player classes.
  • src/: Source files for the project, implementing the logic for the card game.
  • tests/: Unit tests for the project using GoogleTest.
  • docs/: Documentation generated by Doxygen.
  • build/_deps/: Contains the manually downloaded GoogleTest source.

License

This project is licensed under the MIT License. See the LICENSE file for more details.

About

This was my first big project for my C++ class, it's a simple Black Jack game, that lets you pick a number of players, their names, and the game will automatically deal cards and determine the winner.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published