On Tue, Nov 18, 2008 at 2:30 AM, Thomas Davie <tom.davie@gmail.com> wrote:
Wow, that's rather nice, unfortunately I can't run it at the moment, because I've run into the GLUT problems so many people have. I'm wondering though about your definition of randomBehavior.
randomBehavior :: (Random a) => Double -> Behavior a
randomBehavior s = fmap (fst . random . mkStdGen . round . (+s)) time
I don't know the theory behind pseudo random number generators well enough to be sure, but I have a feeling that while this may be good enough for a game, it's probably not good enough for anything the relies on the numbers it generates being totally unpredictable. The reason I say that is that as far as I understand it, the guarentee we're given with a pseudo random number generator is that given an output number, the next output number is impossible to predict. I don't think we're given any guarantee that given a monotonically increasing seed, the output of the generator will look particularly different, or be unpredictable.
Unfortunately, I don't think that I can come up with a better way to define the behavior though. It would be possible to define an Event at a certain interval that splits the random seed at each occurrence, but I can't do better than that.