Skip to content

Instantly share code, notes, and snippets.

@tenntenn
Last active December 10, 2015 02:58
Show Gist options
  • Save tenntenn/4371815 to your computer and use it in GitHub Desktop.
Save tenntenn/4371815 to your computer and use it in GitHub Desktop.
// http://play.golang.org/p/baw3-Q0JFH
package main
import (
"fmt"
"math/rand"
"time"
)
func main() {
for i := 0; i < 3; i++ {
// seed
now := time.Now().UnixNano()
fmt.Println("Seed :", now)
rnd := rand.New(rand.NewSource(now))
for j := 0; j < 5; j++ {
fmt.Println(rnd.Int())
}
fmt.Println()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment