Created
August 20, 2017 14:01
-
-
Save rodrigo-brito/8124b19cfdee47d84440ca7dea098c3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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