Thread: get Turn Function...

  1. #1
    Registered User
    Join Date
    Nov 2005
    Posts
    34

    get Turn Function...

    int getTurn(int input)

    ok im trying to write a function that throws the dice and tells the player the results and adds up the total score. This function will have the old score as the input and the new score as the output.

  2. #2
    Cheesy Poofs! PJYelton's Avatar
    Join Date
    Sep 2002
    Location
    Boulder
    Posts
    1,728
    And your question is??

    We aren't just going to write the function for you. Also, put all of your questions about this program in one thread instead of multiple threads.

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    2,663
    In case no one has figured it out yet, findme posts to this forum to get people to do his/her homework for them.

  4. #4
    Registered User
    Join Date
    Nov 2005
    Posts
    34
    no actually i don't. i just need little tips. not someone to do my homework.

  5. #5
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Little tips can add up to big programs.

    People here generally don't like it when people make a post on what they need to have done without posting an attempt. That's not asking for a tip, that's asking for a foundation, and when you don't understand that, you'll just end up asking people to finish it for you.
    Last edited by SlyMaelstrom; 11-29-2005 at 11:11 PM.
    Sent from my iPadŽ

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    Your function will look something like this:
    Code:
    int getTurn(int OldScore)
    {
       int NewScore;
       //insert code to generate new score and assign it to NewScore
       return NewScore;
    }
    For a dice role you might want to look into srand() and rand() functions.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. doubt in c parser coding
    By akshara.sinha in forum C Programming
    Replies: 4
    Last Post: 12-23-2007, 01:49 PM
  2. Message class ** Need help befor 12am tonight**
    By TransformedBG in forum C++ Programming
    Replies: 1
    Last Post: 11-29-2006, 11:03 PM
  3. C++ compilation issues
    By Rupan in forum C++ Programming
    Replies: 1
    Last Post: 08-22-2005, 05:45 AM
  4. c++ linking problem for x11
    By kron in forum Linux Programming
    Replies: 1
    Last Post: 11-19-2004, 10:18 AM
  5. Replies: 4
    Last Post: 11-23-2003, 07:15 AM