Professional Web Applications Themes

'random' not really random ? - Macromedia Director Basics

I'm developing a cardgame that randomly draws 5 cards at the push of a button. The game is up and running (mostly), but during testing, I noticed that when the same conditions are met, the game tends to 'randomly' draw the same cards. (I'm not using the randomseed, just 'rnd'...) I remember reading somewhere a while ago that the random-command isn't really random, but is dependent on the processor. I don't know the technical details, but do correct me if I'm wrong... Has anyone else encountered this ? And is there a way to fix this ? Or did I ...

  1. #1

    Default 'random' not really random ?

    I'm developing a cardgame that randomly draws 5 cards at the push of a
    button. The game is up and running (mostly), but during testing, I noticed
    that when the same conditions are met, the game tends to 'randomly' draw the
    same cards. (I'm not using the randomseed, just 'rnd'...)

    I remember reading somewhere a while ago that the random-command isn't
    really random, but is dependent on the processor. I don't know the technical
    details, but do correct me if I'm wrong...

    Has anyone else encountered this ? And is there a way to fix this ? Or did I
    maybe make a mistake in my scripting ?




    Somnifer Guest

  2. #2

    Default Re: 'random' not really random ?

    The randomness is not as prefect as nature, you would not want lingo's
    random to control the payoffs of an online ganbling site.

    The randomSeed might ba automatically scrambled, but you can set it to a
    different value each time a random series is started with

    the randomSeed = the milliseconds

    Better to have user click initiate it, rather than say prepareMovie when
    the milliseconds tends to be the same value each time.
    JB Guest

  3. #3

    Default Re: 'random' not really random ?

    How such a single line of code can make such a huge difference... The drawn
    results are much better now.
    Thank you for the tip !

    "JB" <lingoguysbcglobal.net> schreef in bericht
    news:lingoguy-DEF4D1.15035830042004forums.macromedia.com...
    > The randomness is not as prefect as nature, you would not want lingo's
    > random to control the payoffs of an online ganbling site.
    >
    > The randomSeed might ba automatically scrambled, but you can set it to a
    > different value each time a random series is started with
    >
    > the randomSeed = the milliseconds
    >
    > Better to have user click initiate it, rather than say prepareMovie when
    > the milliseconds tends to be the same value each time.

    Somnifer Guest

  4. #4

    Default Re: 'random' not really random ?

    In article <c6ufeh$s9v$1forums.macromedia.com>, "Somnifer" <somniferpandora.be> wrote:
    >I'm developing a cardgame that randomly draws 5 cards at the push of a
    >button. The game is up and running (mostly), but during testing, I noticed
    >that when the same conditions are met, the game tends to 'randomly' draw the
    >same cards. (I'm not using the randomseed, just 'rnd'...)
    >
    >I remember reading somewhere a while ago that the random-command isn't
    >really random, but is dependent on the processor. I don't know the technical
    >details, but do correct me if I'm wrong...
    >
    >Has anyone else encountered this ? And is there a way to fix this ? Or did I
    >maybe make a mistake in my scripting ?
    >
    >
    >
    >
    I don't know if Director does this deliberately (sp?) but Visual Basic gives
    you the same sequence of random numbers from the generator unless you use the
    command "randomize timer" (which is equivalent in VB to the fix you were given
    for Director.) InVB it is deliberate to aid in the debugging process -- giving
    a predictable sequence for debugging. Once the program is up and ready to run
    you slip in the command that makes it as random as possible. It wouldn't
    surprise me to find that Director did it for the same reason.

    BJ
    BJChadwick Guest

Similar Threads

  1. how can i Random?
    By Exccelibar webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 3
    Last Post: February 1st, 02:07 PM
  2. Using Math.random to go to random frames
    By Glen Gummess webforumsuser@macromedia.com in forum Adobe Flash, Flex & Director
    Replies: 2
    Last Post: January 23rd, 10:26 PM
  3. Random.h
    By Nils-Erik Svangård in forum Debian
    Replies: 1
    Last Post: July 28th, 11:10 AM
  4. PS7 random dpi changes 200 -> 300 HELP
    By Mac McDougald in forum Adobe Photoshop 7, CS, CS2 & CS3
    Replies: 3
    Last Post: July 10th, 06:09 PM
  5. Random image in a random place.
    By JoshR webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 0
    Last Post: July 8th, 03:18 AM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139