Thread: randomize

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    28

    Unhappy randomize

    hello
    i need help. i have a program due tomorrow that needs to have the function random in it and i would like to have some one give me some ideas it would be real nice if it was a program that has randome in it and it is real simple.

    The strongest fighter DOESN'T always win the fight!

  2. #2
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Code:
    #include <iostream>
    #include <cstdlib>
    
    int main(void) {
        using namespace std;
    
        cout << rand();
        return 0;
    }
    That is as good as it is going to get from me. You should do your own homework. Unless of course you need to write your own random function. If so you could use the Mersenne Twister algorithm.

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    28
    hey,
    i need help with the random program so im gonna simplify my question. i just want to know what is the random include file and how do u call it?
    could u at least answer that.
    thanks!

  4. #4
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. randomize array blackjack c program
    By bazzano in forum C Programming
    Replies: 4
    Last Post: 09-01-2005, 02:05 PM
  2. don't want to randomize two alike numbers
    By randomizer in forum C++ Programming
    Replies: 8
    Last Post: 05-26-2005, 07:42 PM
  3. randomize hex digits
    By wazilian in forum C Programming
    Replies: 3
    Last Post: 12-14-2002, 03:20 AM
  4. Problem with Visual C++ ( randomize function )!
    By marCplusplus in forum C++ Programming
    Replies: 2
    Last Post: 12-17-2001, 01:01 PM
  5. Randomize Number Function
    By beyonddc in forum C Programming
    Replies: 3
    Last Post: 12-10-2001, 04:31 AM