How hard is it to create a not-so-random number generator?

Posted by Duracell on Stack Overflow See other posts from Stack Overflow or by Duracell
Published on 2010-06-17T11:02:42Z Indexed on 2010/06/17 11:03 UTC
Read the original article Hit count: 251

Backstory:

So I was driving to band practice this evening. My car has a USB port where you can plug in a USB stick with MP3 files on it and the stereo will play them. I have about 100 MP3s on my stick so I pushed the 'Random' button. So from here to band practice, it played:

  • Track 22
  • Track 45
  • Track 4
  • Track 11
  • Track 87
  • Track 66
  • Track 98

Then on the way home, it played

  • Track 16
  • Track 27
  • Track 33

And then I stopped at the petrol station. I filled up, got back in the car and the stereo fired up again. It played

  • Track 22
  • Track 45
  • Track 4
  • Track 11
  • Track 87

I thought, WTF? What's with this 'random' generator? What are they using as a seed, if not time? Is a car stereo so memory-tight that it can't even use the C stdlib? Does anyone know how this kind of thing happens?

© Stack Overflow or respective owner

Related posts about random-number-generator