2023-11-05 23:49:27 +01:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/rand"
|
|
|
|
)
|
|
|
|
|
2023-11-05 23:51:39 +01:00
|
|
|
// getFoodItem returns an emoji from a string used to represent food
|
|
|
|
// Takes no arguments, but returns an emoji/rune from a predefined string
|
2023-11-05 23:49:27 +01:00
|
|
|
func getFoodItem() rune {
|
|
|
|
var foods string = "🐵🐱🐷🐁🐇🐿🦇🐓🐣🐸🦎🍎🍏"
|
|
|
|
foodsRune := []rune(foods)
|
|
|
|
randomIndex := rand.Intn(len(foodsRune))
|
|
|
|
return foodsRune[randomIndex]
|
|
|
|
}
|