types.go 210 B

12345678910111213141516171819202122
  1. package main
  2. const (
  3. Left = iota
  4. Right
  5. Up
  6. Down
  7. )
  8. type Position struct {
  9. x int
  10. y int
  11. }
  12. type Apple Position
  13. type Snake struct {
  14. head Position
  15. tail []Position
  16. length int
  17. direction int
  18. }