User Tag List

Results 1 to 5 of 5

Thread: Random value?

  1. #1
    Octorok
    Join Date
    Jan 2008
    Age
    32
    Posts
    129
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    939
    Level
    10
    vBActivity - Bars
    Lv. Percent
    63.88%

    Random value?

    I can't find the documentation on this... A random value would be quite useful.
    It would be like on a calculator: rand int (1,10->A
    So A would take a value between 1 and 10... It would be useful for scripts...

  2. #2
    Keese
    Join Date
    Jan 2008
    Age
    28
    Posts
    52
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    746
    Level
    9
    vBActivity - Bars
    Lv. Percent
    60.29%

    Re: Random value?

    If I remember correctly it's something like:
    int A = rand(1-10)
    or something.

  3. #3
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    32
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,304
    Level
    26
    vBActivity - Bars
    Lv. Percent
    8.79%

    Re: Random value?

    int A = Rand(10)+1;

    Rand(10) picks a random integer value from 0 to 9.

  4. #4
    On top of the world ShadowTiger's Avatar
    Join Date
    Jun 2002
    Location
    Southeastern New York
    Posts
    12,231
    Mentioned
    31 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    29,580
    Level
    46
    vBActivity - Bars
    Lv. Percent
    60.37%
    Achievements It's over 9000!

    Re: Random value?

    I'm sorry, refresh my memory; why does it need a +1? Is that so it escapes the 0-9 range and goes from 1-10?

  5. #5
    Developer
    ZC Developer

    Join Date
    Aug 2006
    Location
    Australia
    Age
    37
    Posts
    2,777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,851
    Level
    25
    vBActivity - Bars
    Lv. Percent
    37.76%

    Re: Random value?

    Yes, exactly.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social