×

Discussion Board

Results 1 to 3 of 3

Thread: Math::Random()

  1. #1
    chishti.hameed
    Guest

    Math::Random()

    Math::Random() returns me only 1 char, how can i get more than 1 char generated randomly?

    What about Integers?

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Czech Republic
    Posts
    2,037
    Hi,

    I dont know where is your problem, try simply this:

    TInt RandomInt()
    {
    return Math::Rand( iSeed );
    }

    and before of course call

    // Get a random seed from the timer
    TTime now;
    now.HomeTime();
    iSeed = now.Int64();

    Bye
    STeN

  3. #3
    chishti.hameed
    Guest
    Originally posted by stenlik
    Hi,

    I dont know where is your problem, try simply this:

    TInt RandomInt()
    {
    return Math::Rand( iSeed );
    }

    and before of course call

    // Get a random seed from the timer
    TTime now;
    now.HomeTime();
    iSeed = now.Int64();

    Bye
    STeN
    Got it :-)
    thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×