Jump to content

Proposal for plugins using a 'Reseed' button


midora
 Share

Recommended Posts

There are some plugins out which use a 'Reseed' button to generate new sets of pseudo random numbers used to generate different patterns.

The problem with this solution is that the result are not reproducable. The user clicks the 'Reseed' button and gets a new pattern which does not look as good as the last one. And there is no chance to go back.

So I propose the authors to use an integer control instead of a button which allows to select a seed value. This seed value can be used to start a new sequence of random numbers.

Because of the way pseudo random numbers are defined you will always get the same sequence of numbers after reseting the seed to the same value.

Example to create a noise matrix:

	private void GenerateNoise( int seed)
	{
		Random random = new Random(seed);
		int x, y;
		for (x = 0; x < noiseWH; x++)
			for (y = 0; y < noiseWH; y++)
			{
				noise[x, y] = random.NextDouble();
			}
	} /* GenerateNoise */

Calling the function multiple times with the same seed will always create the same matrix.

midoras signature.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...