Random function is not "Random"

jhaasjhaas Member Posts: 233
edited November -1 in Tech Support
Ever try the random function? I created a simple test that generates a random number between 1 and 25 every time you touch the screen.

This works fine when running on the Mac. However when you load this to the device via the viewer app, I get the SAME pattern of numbers every time I run the app....11, 2, 25, 13...

Is this a known bug or is there some way to "seed" the random function I'm not aware of. I searched for Random in the wiki and only get the initial page.

This is a real problem. )

Cheers.

Comments

  • jhaasjhaas Member Posts: 233
    I just submitted the same test through the xcode process to run a test on the device outside of the viewer app. Same results and same repeating pattern of numbers every time.

    A little help please... :)
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    Interesting. I made a simple random one as well and couldn't get a pattern of randomness.

    I'll try to look for it in other cases.
  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    I see it on the Web Preview though. 10,11,2,25,13

    Aren't those the same numbers for the island of Lost.(TV show) :)
  • harrioharrio Member Posts: 234
    what's cookin,

    yeah, tshirtbooth, told me about this problem a week ago. i told him then i thought it was somehow related to 'seeding' on the iphone/touch.

    definately needs to be sorted out.

    noodles...
  • TobyToby Member Posts: 478
    Yep, have a ramdom placement issue with all actors in my game and they appear in the exact same spots almost every time when tested on the iphone 3GS using GS Viewer. In the GS app on the mac the random placement works fine.

    Weird one. Fix coming soon?
Sign In or Register to comment.