A couple of years ago I posted a class that generats pseudo-random numbers in a repeatable way. This is useful for a variety of tasks, but a recent comment reminded me that I hadn’t tested its performance. Today I’ll pit my repeatable random function against the standard Math.random function as well as Skyboy’s repeatable random class. Read on for the results!
Posts Tagged random
Repeatable Random
Oct 21
Everybody knows about Math.random(), and for good reason. It’s pretty much the way to get random numbers in AS3, AS2, and JavaScript other than bizarre alternatives like AS3′s BitmapData.noise(). However, it has one critical problem that arises when you want to repeat a certain test or prevent game cheaters from exploiting the randomizer until they get an “easy” setup or desirable outcome. This problem is the lack of repeatability.