Answers for "golang radom array"

0

golang radom array

package main

import (
    "fmt"
    "math/rand"
    "time"
)

func main() {
    //Provide seed
    rand.Seed(time.Now().Unix())

    //Generate a random array of length n
    fmt.Println(rand.Perm(10))
    fmt.Println(rand.Perm(10))
}
Posted by: Guest on March-11-2021

Code answers related to "Dart"

Browse Popular Code Answers by Language