Skip to content

Latest commit

 

History

History
55 lines (36 loc) · 1.71 KB

README.md

File metadata and controls

55 lines (36 loc) · 1.71 KB

Rock-Paper-Scissors Game

This project implements a simple command-line version of the classic rock-paper-scissors game in C++, using Object-Oriented Programming (OOP) principles

Features

  • Implements game logic using classes and objects in C++
  • Allows the player to choose between rock, paper, or scissors
  • Randomly generates the opponent's choice
  • Determines the winner based on the game rules
  • Provides an animated ASCII art display during gameplay

Object-Oriented Design

The game leverages OOP concepts with the following classes:

  • Player: Manages user input and choice selection
  • Opponent: Generates random choices for the opponent
  • Result: Stores game outcomes
  • RockPaperScissors: Orchestrates the game flow, input/output, and game logic

Prerequisites

Before running the game, ensure you have the following installed:

  • Visual Studio Code
  • C/C++ extension for Visual Studio Code
  • C++ compiler (e.g., g++ for Windows or macOS)

Getting Started

  1. Clone the repository:

    git clone https://github.com/0xsuid/cpp-rock-paper-scissors
  2. Open the project in Visual Studio Code

  3. Build and run the program using the provided tasks and launch configurations

How to Play

  1. Open a terminal in Visual Studio Code

    • Navigate to the project directory
    • Build the program using the build task (Ctrl+Shift+B)
  2. Run the program (F5 for debugging or Ctrl+F5 for running without debugging)

  3. Follow the on-screen instructions to play the game:

    • Enter 1 for Rock, 2 for Paper, or 3 for Scissors
    • See the opponent's choice and find out who wins each round

License

This project is licensed under the AGPLv3 License - see the LICENSE file for details