0

I want to shuffle a hard-coded list of values, and be able to get the same result across devices. So, I thought that instead of sending the shuffled list's values, send only a number to initialize rand().

Would it work? Do srand() and rand() work the same across devices (including the simulator?)

jscs
  • 63,694
  • 13
  • 151
  • 195
Aviad Ben Dov
  • 6,351
  • 2
  • 34
  • 45
  • 1
    What happened when you tried it? – matt Aug 01 '15 at 14:31
  • This will of course work for the same implementation of the PRNG; the only question would be whether it changes/has changed between system (stdlib) versions, which I don't know how to check. Interesting question. – jscs Aug 01 '15 at 19:12
  • A question I asked more than 3 years ago http://stackoverflow.com/questions/9343421/creating-and-managing-two-independent-random-number-sequences – Kaan Dedeoglu Aug 01 '15 at 19:14

0 Answers0