AlgoGenesis / C

AlgoGenesis is a centralized open-source platform dedicated to providing optimized and well-documented algorithm implementations in C. Perfect for both beginners and advanced users, this repository serves as a comprehensive learning resource for solving algorithmic challenges.
MIT License
81 stars 253 forks source link

Stone Paper Scissor Via Recursion #1272

Open MithanshuHedau opened 3 hours ago

MithanshuHedau commented 3 hours ago

Name: Stone Paper Scissor Via Recurssion

About:

The Stone-Paper-Scissors game implemented in C++ is a simple yet engaging interactive program where the user competes against the computer in a hand game that involves three choices: rock (r), paper (p), and scissors (s). The game begins by prompting the user for the number of rounds to play, initializing counters for both the user and the computer's wins. The core gameplay is managed through a recursive function called playGame, which handles each round by allowing the user to input their choice while the computer randomly selects its move. After each round, the winner is determined based on the game rules, and the corresponding win counter is updated. The recursion continues until all rounds are completed, at which point the program checks the win counters and announces the overall winner. This implementation effectively demonstrates the principles of recursion, making it an excellent exercise for understanding game logic and function calls in programming.

Labels:

new algorithm, gssoc-ext, hacktoberfest, level1


Assignees:

MithanshuHedau commented 3 hours ago

@pankaj-bind please assign me this issue , for my Contribution in that