cli

package
v0.0.0-...-7af1aca Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 7 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultGlyphs = Glyphs{
	White: GlyphSet{
		Flat:     "W",
		Standing: "WS",
		Capstone: "WC",
	},
	Black: GlyphSet{
		Flat:     "B",
		Standing: "BS",
		Capstone: "BC",
	},
}
View Source
var UnicodeGlyphs = Glyphs{
	White: GlyphSet{
		Flat:     "⬜",
		Standing: "║",
		Capstone: "△",
	},
	Black: GlyphSet{
		Flat:     "⬛",
		Standing: "┃",
		Capstone: "▲",
	},
}

Functions

func RenderBoard

func RenderBoard(g *Glyphs, out io.Writer, p *tak.Position)

Types

type CLI

type CLI struct {
	Config tak.Config
	Glyphs *Glyphs
	Out    io.Writer
	White  Player
	Black  Player
	// contains filtered or unexported fields
}

func (*CLI) Moves

func (c *CLI) Moves() []tak.Move

func (*CLI) Play

func (c *CLI) Play() *tak.Position

type GlyphSet

type GlyphSet struct {
	Flat     string
	Standing string
	Capstone string
}

type Glyphs

type Glyphs struct {
	White, Black GlyphSet
}

type Player

type Player interface {
	GetMove(p *tak.Position) tak.Move
}

func NewCLIPlayer

func NewCLIPlayer(out io.Writer, in *bufio.Reader) Player

Jump to

Keyboard shortcuts

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