hash - Pseudorandom seed methodology for lookup tables -


Can somebody recommend a good way of assuming the global seed, e.g. "Hello World" and use that value to see values ​​in arrays or tables.

I'm thinking that like the classic spacingfireing game "Elite" where there were different characteristics for the planets but they were not random, just get from the seed value for the universe.

I was thinking of MD5 at input value and then using bytes from hash, had cast it into an integer and changed them to acceptable indexes for lookup tables, but I doubt Is that a better way to be? I've read something about Merson Toowaster, but maybe it will end.

I'm expecting something that will break good values ​​in my lookup tables. Like red, orange, yellow, green, blue, purple,

I also do not see random values, but every time I see constant values.

Update: Probably being difficult to express my own problem domain here is an example of a site that uses generators and can generate X numbers:

Additional criteria

I like to work with the principles first, such as library functions, systems.

Public Star System (long system sd) {java.util.Random r = new random (systemSeed); Color c = colorArray [r.nextInt (colorArray.length)]; // Depending on your seed, produces an SEO-random number Politics System Politics = PoliticsArere [R.NXInt (PoliticsArrangers)]; ...}

For any seed, it will produce the same color and the same political arrangement every time.

To get the starting seed from a string simply use MD5Sum and hold your long / first 64bits, the other approach will be to make a numerical use for each plant only. Elite has also generated the names of each system using its pseudo-random-generator. (Long seed = 1; seeds

  {starSystems.add (new StarSystem (seed)); }  

Every time the known value is set the seed will return the same sequence every time randomly, so it is that when one is trying good random values, then one Good seed is very important. However in your case a known seed will produce the results of the search for you.

C # is equivalent

  Public Star System (Int. System) {System.Random r = new Random (systemSeed); Color C = ColorRay [RNXT (ColorRay lamp)]; // Generates an SEO-random number based on your seed Politics politics Politics = politicsArere [R. Nxt (politics of thigh)]; ...}  

Notice a difference? No, I did not.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -