commands

package
v1.0.31 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TERM_RESET = "\033[0m"

	TERM_BG_GRAY  = "\033[48;2;127;127;127m"
	TERM_BG_WHITE = "\033[107m"

	TERM_FG_GRAY      = "\033[38;2;127;127;127m"
	TERM_FG_LIGHTGRAY = "\033[38;2;200;200;200m"
	TERM_FG_FOOD      = "\033[38;2;255;92;117m"
	TERM_FG_RGB       = "\033[38;2;%d;%d;%dm"
)

ANSI escape codes to be used in the color output of the board view

Variables

View Source
var DebugRequests bool
View Source
var FoodSpawnChance int32
View Source
var GameId string
View Source
var GameType string
View Source
var HazardDamagePerTurn int32
View Source
var Height int32
View Source
var HttpClient http.Client
View Source
var MinimumFood int32
View Source
var Names []string
View Source
var Output string
View Source
var Seed int64
View Source
var Sequential bool
View Source
var ShrinkEveryNTurns int32
View Source
var Squads []string
View Source
var Timeout int32
View Source
var Turn int32
View Source
var TurnDelay int32
View Source
var TurnDuration int32
View Source
var URLs []string
View Source
var UseColor bool
View Source
var ViewMap bool
View Source
var Width int32

Functions

func Execute

func Execute()

Types

type GameExporter

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

func (*GameExporter) AddSnakeRequest

func (ge *GameExporter) AddSnakeRequest(snakeRequest client.SnakeRequest)

func (*GameExporter) ConvertToJSON

func (ge *GameExporter) ConvertToJSON() ([]string, error)

func (*GameExporter) FlushToFile

func (ge *GameExporter) FlushToFile(filepath string, format string) error

type SnakeState

type SnakeState struct {
	URL       string
	Name      string
	ID        string
	LastMove  string
	Squad     string
	Character rune
	Color     string
	Head      string
	Tail      string
}

Used to store state for each SnakeState while running a local game

Jump to

Keyboard shortcuts

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