types.go 287 B

12345678910111213141516171819202122232425262728
  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. }
  19. type Score struct {
  20. score int
  21. scoreCounter int
  22. reason int
  23. }