User Tools

Site Tools


haas:fall2011:cprog:projects:rockpaperscissors

Game: Rock, Paper, Scissors

In this project your task is to implement a playable “Rock, Paper, Scissors” program to play against the computer.

Rules

  • Our game will be designed for two players.
    • You will be one player
    • The computer will be the other player
  • There are three objects which can be played: a rock, a piece of paper, and a pair of scissors.
  • The rock will break the scissors (rock beats scissors)
  • The paper will cover the rock (paper beats rock)
  • The scissors will cut the paper (scissors beats paper)
  • Gameplay will consist of three rounds
    • whoever has triumphed the majority of the time will win

Programming Considerations

  • You can design your program so that a certain player always goes first, or have that be picked randomly.
  • Computer's choice will be pseudo-random, using the C random number generator.
  • your program should display a welcome message and offer to print instructions.
    • This means you will need to accept input from the user on STDIN and properly evaluate it.
  • Throughout the program, check for invalid input.
    • Output a message and keep looping until the correct value is entered.
  • Upon the user's turn:
    • your program should prompt you for the item you wish to pick
    • You are free to come up with any sort of input scheme (1 for rock, 2 for paper, etc.).
  • Upon the computer's turn:
    • you need to print out a message indicating what piece the computer has “chosen”.
  • At the end of each round:
    • display who won the round
    • explain how the round was won
  • a score needs to be kept, so at the end of the third round, you can display the winner.
  • When the game is over, ask the user if they wish to play again.
    • If yes, the game will be played again (3 rounds)
    • If no, the program should exit
haas/fall2011/cprog/projects/rockpaperscissors.txt · Last modified: 2011/08/21 15:50 by 127.0.0.1