Re: [go-nuts] fixed random number trouble

2018-03-15 Thread matthewjuran
crypto/rand is another option. I use the math/rand repeatability to be able to regenerate a picture made of random elements, where I modify the seed until I’m happy with the result but later I may need to re-render at different dimensions or with other parameters. Matt On Thursday, March 15,

Re: [go-nuts] fixed random number trouble

2018-03-15 Thread Michael Jones
As it turns out, repeatability of "random" experiments is very important, especially during development. On Wed, Mar 14, 2018 at 11:35 PM, Andrea Alessandrini wrote: > > > Il giorno mercoledì 14 marzo 2018 18:38:51 UTC+1, Burak Serdar ha scritto: >> >> It is explained here: >> >> https://golang.

Re: [go-nuts] fixed random number trouble

2018-03-14 Thread Andrea Alessandrini
Il giorno mercoledì 14 marzo 2018 18:38:51 UTC+1, Burak Serdar ha scritto: > > It is explained here: > > https://golang.org/pkg/math/rand/ > > oh, thanks a lot. Now I can see that's a quite common doubt :-) https://stackoverflow.com/questions/45753397/why-does-golang-repeats-the-same-ran

Re: [go-nuts] fixed random number trouble

2018-03-14 Thread Burak Serdar
It is explained here: https://golang.org/pkg/math/rand/ On Wed, Mar 14, 2018 at 11:26 AM, Andrea Alessandrini wrote: > I wrote this simple code > > package main > import ( > "fmt" > "math/rand" > ) > func main() { > for i := 0; i < 6; i++ { > fmt.Println("My favorite number is", rand.

[go-nuts] fixed random number trouble

2018-03-14 Thread Andrea Alessandrini
I wrote this simple code package main import ( "fmt" "math/rand" ) func main() { for i := 0; i < 6; i++ { fmt.Println("My favorite number is", rand.Intn(100)) fmt.Println("My favorite number is", rand.Int()) } } and I run it in my pc or in a web application (https://tour