15 lines
386 B
Go

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