Elaine is working on a new children's game that features animals and magic wands. It is time to code functions for rolling a die, generating random wand energy and shuffling a slice.
Implement a RollADie function.
This will be the traditional twenty-sided die with numbers 1 to 20.
d := RollADie() // d will be assigned a random int, 1 <= d <= 20Implement a GenerateWandEnergy function.
The wand energy should be a random floating point number equal or greater than 0.0 and less than 12.0.
f := GenerateWandEnergy() // f will be assigned a random float64, 0.0 <= f < 12.0The game features eight different animals:
Write a function ShuffleAnimals that returns a slice with the eight animals in random order.
Elaine is working on a new children's game that features animals and magic wands. It is time to code functions for rolling a die, generating random wand energy and shuffling a slice.
Implement a RollADie function.
This will be the traditional twenty-sided die with numbers 1 to 20.
d := RollADie() // d will be assigned a random int, 1 <= d <= 20Implement a GenerateWandEnergy function.
The wand energy should be a random floating point number equal or greater than 0.0 and less than 12.0.
f := GenerateWandEnergy() // f will be assigned a random float64, 0.0 <= f < 12.0The game features eight different animals:
Write a function ShuffleAnimals that returns a slice with the eight animals in random order.