This is the Rock-paper-scissors game created in C programming language.
This code is a simple Rock, Paper, Scissors game played against the computer.
- The
game
function determines the outcome: a draw, a win, or a loss based on the rules of Rock, Paper, Scissors. - The
main
function seeds the random number generator to ensure different outcomes each run. - A loop runs 100 rounds of the game.
- In each round, a random number determines the computer's choice (Rock, Paper, or Scissors).
- The user is prompted to enter their choice.
- The
game
function is called to compare the user's choice with the computer's. - The result (win, loss, or draw) is printed.
- The user's and computer's choices are displayed.
- The loop repeats for the specified number of rounds.
- The program ends after completing all rounds.