12345678910111213141516171819202122232425262728293031323334353637 |
- package snakesimulator
- import (
- "math/rand"
- "time"
- )
- func (f *Field) GenerateNextFood() {
- rand.Seed(time.Now().UnixNano())
- f.Food.X = rand.Uint32() % f.Width
- f.Food.Y = rand.Uint32() % f.Height
- }
|