snake

package
v0.66.4 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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