snake

package
v3.0.0-rc+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command string
const (
	CommandToNorth Command = "n"
	CommandToEast  Command = "e"
	CommandToSouth Command = "s"
	CommandToWest  Command = "w"
)

type Snake

type Snake struct {
	// contains filtered or unexported fields
}

Snake object

func NewSnake

func NewSnake(world *world.World) (*Snake, error)

NewSnake creates new snake

func (*Snake) Command

func (s *Snake) Command(cmd Command) error

func (*Snake) Die

func (s *Snake) Die()

func (*Snake) Feed

func (s *Snake) Feed(f int8)

func (*Snake) MarshalJSON

func (s *Snake) MarshalJSON() ([]byte, error)

func (*Snake) Run

func (s *Snake) Run(stop <-chan struct{})

func (*Snake) Strength

func (s *Snake) Strength() float32

func (*Snake) String

func (s *Snake) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL