Documentation ¶
Index ¶
- Constants
- Variables
- func CompareBoards[T ~[][]E, E comparable](a T, b T) (equal bool)
- func CreateBoard[T any](w int, h int) [][]T
- func ErrorWithBack(err error) tea.Msg
- func NewBackBinding() key.Binding
- func NewHelpBinding() key.Binding
- func NewResetBinding() key.Binding
- func NewSaveBinding() key.Binding
- func RenderBoard[T any](board [][]T, renderCell func(cell T) string) string
- type ArrowsKeyMap
- type BackMsg
- type ErrorMsg
- type Metadata
Constants ¶
View Source
const ( ICON_WIDTH = 15 ICON_HEIGHT = 7 )
Variables ¶
View Source
var ( EnableSsh = flag.Bool("ssh", false, "turns into a ssh server") // https://github.com/muesli/termenv/blob/51d72d34e2b9778a31aa5dd79fbdd8cdac50b4d5/profile.go#L12 ColorProfile = flag.Int("profile", 1, "chooses a color profile") EnableMultiplayer = flag.Bool("multiplayer", true, "enables multiplayer mode") )
View Source
var ( Twenty48 = (func() Metadata { logo := lipgloss.NewStyle(). Background(lipgloss.Color("214")). Align(lipgloss.Center). Padding(3, 6). PaddingRight(5). Margin(1, 2). Render("2048") return Metadata{ Name: "2048", Features: []string{"saving"}, Icon: logo, ID: 0, } })() TicTacToe = (func() Metadata { logo := lipgloss.NewStyle(). Background(lipgloss.Color("168")). Align(lipgloss.Center). Padding(3, 6). Margin(1, 2). Render("X/O") return Metadata{ Name: "TicTacToe", Features: []string{"saving", "multiplayer"}, Icon: logo, ID: 1, } })() Chess = (func() Metadata { logo := lipgloss.NewStyle(). Background(lipgloss.Color("63")). Align(lipgloss.Center). Padding(3, 6). Margin(1, 2). Render("♚ ♖") return Metadata{ Name: "TicTacToe", Features: []string{"saving", "multiplayer"}, Icon: logo, ID: 2, } })() Snake = (func() Metadata { logo := lipgloss.NewStyle(). Background(lipgloss.Color("70")). Align(lipgloss.Center). Padding(3, 6). Margin(1, 2). Render("Snake") return Metadata{ Name: "Snake", Features: []string{}, Icon: logo, ID: 3, } })() Saves = (func() Metadata { logo := lipgloss.NewStyle(). Background(lipgloss.Color("244")). Align(lipgloss.Center). Padding(3, 5). Margin(1, 2). Render("Saves") return Metadata{ Name: "Saves", Icon: logo, ID: 4, } })() )
Functions ¶
func CompareBoards ¶
func CompareBoards[T ~[][]E, E comparable](a T, b T) (equal bool)
func CreateBoard ¶
func ErrorWithBack ¶
func NewBackBinding ¶
func NewHelpBinding ¶
func NewResetBinding ¶
func NewSaveBinding ¶
func RenderBoard ¶
Types ¶
type ArrowsKeyMap ¶
func NewArrowsKeyMap ¶
func NewArrowsKeyMap() ArrowsKeyMap
Click to show internal directories.
Click to hide internal directories.