38 lines
1.0 KiB
Go
38 lines
1.0 KiB
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"math/rand"
|
|
"time"
|
|
)
|
|
|
|
func main() {
|
|
animals := []string{
|
|
"Fox", "Rabbit", "Panda", "Penguin", "Koala", "Squirrel", "Owl", "Hedgehog", "Cat", "Dog",
|
|
"Deer", "Elephant", "Otter", "Raccoon", "Sloth", "Mouse", "Turtle", "Bear", "Chick", "Sheep",
|
|
}
|
|
|
|
occupations := []string{
|
|
"Doctor", "Teacher", "Chef", "Firefighter", "Police Officer", "Astronaut", "Artist", "Musician",
|
|
"Engineer", "Scientist", "Pilot", "Farmer", "Librarian", "Detective", "Photographer", "Writer",
|
|
"Carpenter", "Mechanic", "Veterinarian", "Zookeeper",
|
|
}
|
|
|
|
// Seed the random number generator
|
|
rand.Seed(time.Now().UnixNano())
|
|
|
|
// Shuffle both lists
|
|
rand.Shuffle(len(animals), func(i, j int) {
|
|
animals[i], animals[j] = animals[j], animals[i]
|
|
})
|
|
|
|
rand.Shuffle(len(occupations), func(i, j int) {
|
|
occupations[i], occupations[j] = occupations[j], occupations[i]
|
|
})
|
|
|
|
// Print the randomly paired animals and occupations
|
|
for i := 0; i < len(animals); i++ {
|
|
fmt.Printf("%s %s\n", animals[i], occupations[i])
|
|
}
|
|
}
|