Hacker News new | past | comments | ask | show | jobs | submit login
Five million people see a classic case of calling random()without reseeding (stochasticgeometry.wordpress.com)
26 points by markdennehy on Oct 24, 2009 | hide | past | favorite | 10 comments



This is partly the fault of Flash itself. It doesn't provide control over seeding the API's PRNG.

A diligent coder can of course implement their own PRNG method, but that is not an excuse for providing a half-broken feature.


The regular random number generator in Flash is automatically seeded and you can't specify a seed. This article, though, talks about using BitmapData.noise() which takes a seed as a parameter, and normally when I see people discussing the use of that API for general purpose random number generation it is precisely because it allows control over seeding.


rc4 is a prefect algorithm to build a fast and very high quality PRNG for instance.


Reminds me of this classic cautionary tale of poor PRNG seeding, How We Learned to Cheat at Online Poker, http://www.cigital.com/papers/download/developer_gambling.ph...


In PHP 4.2.0 and later, there is no need to seed the random generator with mt_srand(). This is done automatically.

http://www.w3schools.com/php/func_math_mt_rand.asp


Although factually correct I don't see the relevance given that this game is Flash based and written in actionscript. Am I missing something?

Also, why not link directly to the php site? http://php.net/mt_srand


Funny, I was just watching a colleague play this at work the other day.

He'd written an app to play the game for him - takes a screen shot, scans the bitmap, figures out the pieces, then determines an optimum set of moves.


Just like Sweeperbot! http://sweeperbot.org/


well I have tried to see if this is true and it seems like it isn't anymore.


I had the same board as in the article, but it seems to be fixed now.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: