New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with srand #533

Closed
keilmillerjr opened this Issue Jan 8, 2019 · 1 comment

Comments

Projects
None yet
1 participant
@keilmillerjr
Copy link
Contributor

keilmillerjr commented Jan 8, 2019

albertodemichelis/squirrel - srand #172

Having an issue with srand.

  • time() is generating unique times, verified printing to console.
  • srand(time()) is generating the same seed every time.

srand(0) generates a seed, but srand with anything else as a parameter creates a different but non unique seed. I can only obtain two different seeds. Any ideas? Here’s a link to my project rantro-intro.

@keilmillerjr

This comment has been minimized.

Copy link
Contributor

keilmillerjr commented Jan 10, 2019

Apparently seems need to be vastly different to provide proper results. Time in seconds is not enough. I looked at some python libraries for reference. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment