Final Project

Discussion in 'Programming General' started by mopar-user, Mar 27, 2009.

Final Project
  1. Unread #1 - Mar 27, 2009 at 10:47 AM
  2. mopar-user
    Joined:
    Jul 23, 2007
    Posts:
    1,188
    Referrals:
    1
    Sythe Gold:
    0

    mopar-user Guru
    Banned

    Final Project

    My teacher has stated that we are to create a final project. It can be anything as long as he approves of it. I was wondering if anyone had really good ideas. I am using Dev 4.9.9.2. Please give me some great ideas.
     
  3. Unread #2 - Mar 29, 2009 at 1:42 PM
  4. Esuom
    Joined:
    May 3, 2007
    Posts:
    1,731
    Referrals:
    2
    Sythe Gold:
    0

    Esuom Guru
    Banned

    Final Project

    How far along are you? Like, how much do you know about?
     
  5. Unread #3 - Mar 29, 2009 at 4:04 PM
  6. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    Final Project

    Esuom's right in that you should post a list of topics that you've covered to let people know what might be of suitable difficulty. It may even be helpful to say how much at ease you feel with each topic and whether or not you like it and feel it's useful.
     
  7. Unread #4 - Mar 30, 2009 at 11:06 AM
  8. mopar-user
    Joined:
    Jul 23, 2007
    Posts:
    1,188
    Referrals:
    1
    Sythe Gold:
    0

    mopar-user Guru
    Banned

    Final Project

    ummmm vectors, strings, loops, some math operator stuff like isaplha and starting on pointers / structures.
     
  9. Unread #5 - Mar 30, 2009 at 2:34 PM
  10. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    Final Project

    Sorry I forgot to ask before what grade are you in and have you covered Object Oriented topics?
     
  11. Unread #6 - Mar 30, 2009 at 2:54 PM
  12. mopar-user
    Joined:
    Jul 23, 2007
    Posts:
    1,188
    Referrals:
    1
    Sythe Gold:
    0

    mopar-user Guru
    Banned

    Final Project

    Well I got an idea on what I'm going to do. The issue now is that I need to get a completely random number to generate.....I tried rand() but I don't know enough about it to get it to generate randomly each time.

    For Example:

    gold = rand() * level / 2;

    Then it does the calculation and if your level was 1 for instance...it would always output the same number.
     
  13. Unread #7 - Mar 30, 2009 at 5:03 PM
  14. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    Final Project

    You have to seed the pseudo-random number generator first. rand() basically has a list of numbers from which one is picked each time (so it's kind of random and kind of not) and to make its selection different every time (which is considered random) it needs a seed to determine which slot will be picked from first. The time is probably the easiest thing to seed it with and quite effective since the time is always changing.
    Code:
    srand(time(NULL));
    
    You can read more about rand() and srand() at the links below. Feel free to post any other questions you can't find answers too.;)
    http://www.cplusplus.com/reference/clibrary/cstdlib/rand.html
    http://www.cplusplus.com/reference/clibrary/cstdlib/srand.html
     
  15. Unread #8 - Mar 30, 2009 at 5:09 PM
  16. mopar-user
    Joined:
    Jul 23, 2007
    Posts:
    1,188
    Referrals:
    1
    Sythe Gold:
    0

    mopar-user Guru
    Banned

    Final Project

    ok so i do this....

    Code:
    srand(time(NULL));
    
    gold = srand() * level / 2;
    
    or no?
     
  17. Unread #9 - Mar 31, 2009 at 1:40 AM
  18. Nullware
    Joined:
    Jan 30, 2007
    Posts:
    1,761
    Referrals:
    4
    Sythe Gold:
    0

    Nullware Guru

    Final Project

    It would be something like this. You can change the 6 to be whatever you want as its just increasing or decreasing the maximum that can be given to a player of a given level.
    Code:
    	srand(time(NULL));
    	int level = 10;
    	int gold = rand() % (level*6);
     
  19. Unread #10 - Mar 31, 2009 at 7:52 AM
  20. mopar-user
    Joined:
    Jul 23, 2007
    Posts:
    1,188
    Referrals:
    1
    Sythe Gold:
    0

    mopar-user Guru
    Banned

    Final Project

    ok thanks
     
< What programming language should I start with? | .batch >

Users viewing this thread
1 guest


 
 
Adblock breaks this site