-
Notifications
You must be signed in to change notification settings - Fork 18k
math/rand: Uses the same random cycle every time #53355
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
Comments
The time in the playground always starts at the same time to make the playground deterministic. |
It does the same on my pc, but I don't want to have the same result |
|
If you want more random output, try using math/rand#seed. It's listed in the package description of Additionally, with a seed, it's still not completely random:
|
Thank you very much, it works now. |
What version of Go are you using (
go version
)?and
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
Outputand
go env
OutputWhat did you do?
https://go.dev/play/p/pkOzASMb98u
I ran it a couple of times to see if it had other results
What did you expect to see?
another pick from the array "list"
What did you see instead?
every time the pick "arts/12" (
list[11]
)The text was updated successfully, but these errors were encountered: