79086926

Date: 2024-10-14 16:20:09
Score: 2
Natty:
Report link

@chux When I used system time as the seed, sleeping 1 sec after EACH call to srand, the first call to rand also gave linear or almost-linear results.
If graphing the seed vs the result of the first call to rand, the graph apparently would look like a line.
Anyway, it's now clear that rand IS intended to generate the behavior I described. SO, if the program is run at short intervals and time is used as the seed, it will not generate a pseudorandom output. So, I'll run rand with time as the seed, then use the first call to rand, modulus a small number, to determine how many times rand is called to generate the actual random result.

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • User mentioned (1): @chux
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: lorasaur