12. Go - RNG

 import "math/rand"

rand.Seed(time.Now().UnixNano())


variable := rand.intn(50)

// RNG from 0 to 50


rand.Float64()

// RNG from 0 to 1.0


rand.Intn(max-min) + min

// RNG from min to max


rand.Perm(100)

// RNG shuffled array from 0 to 100


Comments

Popular posts from this blog

2. FreeCodeCamp - Dynamic Programming - Learn to Solve Algorithmic Problems & Coding Challenges

20. Data Analytics - Analyze Data to Answer Questions - Week 1

3. Algorithms - Selection Sort