Skip to content

Instantly share code, notes, and snippets.

@rodrigo-brito
Created August 20, 2017 14:01
Show Gist options
  • Save rodrigo-brito/8124b19cfdee47d84440ca7dea098c3c to your computer and use it in GitHub Desktop.
Save rodrigo-brito/8124b19cfdee47d84440ca7dea098c3c to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"math/rand"
"time"
)
const (
MIN = 1
MAX = 25
SIZE = 15
)
func main() {
//Rand numbers
numbers := make(map[int]bool)
//Rand Seed
rand.Seed(time.Now().Unix())
for len(numbers) < SIZE {
value := rand.Intn(MAX) + 1
numbers[value] = true
}
//Result
fmt.Println("RESULT = ", numbers)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment