Help us shape the future of Go! Take the 2026 Go Developer Survey

display

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlayerVSPlayer = iota
	PlayerVSAI
	AIVSAI
)

Variables

View Source
var (
	WhitePieceStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#FFFFFF")).
					Bold(true)

	BlackPieceStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#000000")).
					Bold(true)

	NeutralStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#a19e9e")).
					Bold(true)

	HighlightedStyle = lipgloss.NewStyle().
						Foreground(lipgloss.Color("#1eff00")).
						Bold(true)

	LegalMoveStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("#a19e9e"))

	BoardBorderStyle = lipgloss.NewStyle().
						BorderForeground(lipgloss.Color("#a19e9e")).
						Border(lipgloss.ASCIIBorder())

	StatusPanelStyle = lipgloss.NewStyle().
						Border(lipgloss.ASCIIBorder()).
						BorderForeground(lipgloss.Color("#a19e9e")).
						Padding(1, 2).
						Width(20).
						Align(lipgloss.Center).
						AlignVertical(lipgloss.Center)
)

Functions

func AiMoveCmd

func AiMoveCmd(board *core.Board, depth int, color core.Color) tea.Cmd

func ClearSelection

func ClearSelection(m model) model

func GetBoardSize

func GetBoardSize(board string) (int, int)

func GetSquare

func GetSquare(cursor int) string

func MoveCursor

func MoveCursor(cursor int, direction string) int

Cursor Functions

func MoveCursorToCol

func MoveCursorToCol(cursor int, col string) int

func MoveCursorToRow

func MoveCursorToRow(cursor int, col string) int

func RenderBoard

func RenderBoard(board *core.Board, cursorSq int, selectedMoves []core.Move) string

func RenderStatusPanel

func RenderStatusPanel(m model) string

func RunDisplay

func RunDisplay(mode GameMode)

func SelectSquareForLegalMoves

func SelectSquareForLegalMoves(m model) (model, bool)

func SwitchTurn

func SwitchTurn(m model) model

Helpers

Types

type AiMove

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

type GameMode

type GameMode int

Jump to

Keyboard shortcuts

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