Someone brought up the idea of generating random numbers in the exact same order based off of a seed value, and I started thinking extremely hard on how to do this. We challenged eachother to create an application that does the following:
Generate a set of five random numbers ranging from 1 to 100 every ten seconds based on a seed value. The numbers generated (while using the same seed value) should be exactly the same and generated in exactly the same order, therefor if the application is ran for 20 seconds and the numbers [1, 17, 2, 58, 27, 83, 32, 56, 27, 4] are generated, if the application is restarted these exact same numbers should be generated after 20 seconds, if the same seed was provided.
This will allow for multiple clients to generate the same exact information based off of a single numeric seed value.
Unfortunately after a few days we've both ended up falling short and we're completely clueless as to how to do this. We don't even really know what the proper term for this type of behavior is, however I've called it "Deterministic number generation"
I've tagged both languages that we tried using for this expirement, hoping someone can help us out. This would be a very interesting block of code to experiment with, and we've even thought of ways to improve some of our mobile games by using this strategy, if we can find a way to do it.
Any help would be graciously appreciated.
Aucun commentaire:
Enregistrer un commentaire