Thread: Rock, Scissors, paper

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    1

    Red face Rock, Scissors, paper

    I need help with this homework.
    Have two players each enter one of the three letters R, S, or P without the other player seeing it. The second player then enters one of the three letters R, S, or P. The rules are:
    Rock breaks scissors. If one player has Rock and the other has Scissors, the player who wins and so forth
    when the players both have the same selection, it is a tie.

    Have the program accept the names of the two players.
    Have the game keep track of turns and report the score after each turn.
    When one player has five wine, have the program report that person as the winner.
    Have a "Paly again?"option.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Announcements - C Programming
    Announcements - General Programming Boards

    So post what you've achieved so far.

    And don't say you can't do any of it. You should be able to at least print "RPS" and read some input, even if you don't know what to do next.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Have two players each enter one of the three letters R, S, or P without the other player seeing it.
    In the same computer ? ....then you've to rely on the players' inherent goodness.

    If you're stuck on thinking about the logic, a few hints here:
    1. Make a loop, so that each iteration represents a turn.
    2. Do all Input/output and calculate the score inside the loop.
    3. Keep record of the total score.

  4. #4
    Registered User
    Join Date
    Apr 2006
    Posts
    2,149


    What part are you stuck on?
    It is too clear and so it is hard to see.
    A dunce once searched for fire with a lighted lantern.
    Had he known what fire was,
    He could have cooked his rice much sooner.

  5. #5
    Registered User TheBigH's Avatar
    Join Date
    May 2010
    Location
    Melbourne, Australia
    Posts
    426
    Quote Originally Posted by King Mir View Post


    What part are you stuck on?
    Figuring out how to get other people to do the work.
    Code:
    while(!asleep) {
       sheep++;
    }

  6. #6
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Sure, I will help:
    Code:
    int main(void){
    
         return(0);
    }
    That looks about right. You may want to read through your book again so you know how to fill in the blanks.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  7. #7
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    FAQ I suggest to read are:

    Cprogramming.com FAQ > Clear the screen?
    Last edited by stahta01; 08-25-2011 at 05:42 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Rock, Paper, Scissors
    By Slynet in forum C Programming
    Replies: 2
    Last Post: 02-13-2009, 07:14 PM
  2. paper rock scissors
    By Amyaayaa in forum C++ Programming
    Replies: 4
    Last Post: 02-12-2008, 10:59 AM
  3. rock paper Scissors
    By jackstify in forum C++ Programming
    Replies: 3
    Last Post: 12-14-2007, 10:16 PM
  4. Paper Scissors Rock v0.1
    By Kirdra in forum Game Programming
    Replies: 2
    Last Post: 09-14-2002, 11:32 AM

Tags for this Thread