Skip to content

Conversation

@Bhoomi070
Copy link

@Bhoomi070 Bhoomi070 commented Oct 31, 2025

Hello! This Pull Request refactors the Rock Paper Scissor game to improve code organization and maintainability.

  1. Object-Oriented Refactor: The entire game logic has been moved from main.cpp into a dedicated RockPaperScissor class (rockpaperscissor.hpp and rockpaperscissor.cpp).
    • This cleans up main.cpp significantly (now only a few lines).
    • It separates concerns and makes the code easier to test and extend.
  2. Added Makefile: A standard Makefile is included to simplify building and running the project on Unix-like systems (Linux, macOS, WSL).
    • make build compiles the code.
    • make run compiles and executes the game.
  3. Improved RNG: The Random Number Generator (rand()) is properly seeded using std::srand and std::time in the constructor to ensure different outcomes on subsequent runs.
  4. Updated README: The build instructions in README.md are updated to reflect the use of the Makefile and the new compilation command.

This is a meaningful contribution for Hacktoberfest! Let me know if you have any feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant