This project implements a simple command-line version of the classic rock-paper-scissors game in C++, using Object-Oriented Programming (OOP) principles
- 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
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
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)
-
Clone the repository:
git clone https://github.com/0xsuid/cpp-rock-paper-scissors
-
Open the project in Visual Studio Code
-
Build and run the program using the provided tasks and launch configurations
-
Open a terminal in Visual Studio Code
- Navigate to the project directory
- Build the program using the build task (Ctrl+Shift+B)
-
Run the program (F5 for debugging or Ctrl+F5 for running without debugging)
-
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
This project is licensed under the AGPLv3 License - see the LICENSE file for details