snake

package
v0.40.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CellType

type CellType int
const (
	None CellType = iota
	Snake
	Food
)

type Direction

type Direction int
const (
	Up Direction = iota
	Down
	Left
	Right
)

type Game

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

func NewGame

func NewGame(width, height int, render func(cells [][]CellType, alive bool), logger func(string)) *Game

func (*Game) Exit

func (self *Game) Exit()

func (*Game) SetDirection

func (self *Game) SetDirection(direction Direction)

func (*Game) Start

func (self *Game) Start()

type Position

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

type State

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

Jump to

Keyboard shortcuts

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