Learn creative coding writing simple programs

66. How random is random? randomSeed() & noiseSeed()

If you ever need to get the same random values time after time, you can achieve that by using randomSeed() and noiseSeed(). They affect random() and noise() respectively, and both take just one numeric parameter. By default, Processing selects a random seed for both random() and noise() when your program starts. But if you set a specific seed using randomSeed() or noiseSeed(), the random values you get will be the same each time. For instance, if you run randomSeed(123); and then print(random(100)); the random number you get is always the same number between 0 and 100.

Tags: random, noise, randomSeed, noiseSeed

Code editor

You can make changes to the code below. Then
Below you can ask and answer questions related to this video. If your question is unrelated to the video, please post it at the Processing Forum as I'm unable to help with all of your programs and still have enough free time to eat and sleep :)
comments powered by Disqus