utils

package
v0.0.0-...-6879a08 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMove

func AddMove(moves *[]schemas.InternalMove, color string, from int, to int, piece string, captured string, flags int)

func File

func File(square int) int

Extracts the zero-based file of an 0x88 square

func FromHex

func FromHex(str string) (string, error)

func GetDisambiguator

func GetDisambiguator(move *schemas.InternalMove, moves []schemas.InternalMove) string

Uniquely identifies ambiguous moves

func InferPieceType

func InferPieceType(san string) string

func IsDigit

func IsDigit(str string) bool

func LetterToChessUnicode

func LetterToChessUnicode(letter string) string

func Ox88ToSan

func Ox88ToSan(square int) string

Converts a 0x88 value (int) to Standard Algebraic Notation

func PopMove

func PopMove(history []schemas.History) ([]schemas.History, schemas.History)

func Rank

func Rank(square int) int

Extracts the zero-based rank of an 0x88 square

func Some

func Some[T any](slice []T, test func(T) bool) bool

func StrippedSan

func StrippedSan(move string) string

Parses all of the decorators out of a SAN string

func SwapColors

func SwapColors(color string) string

func ToHex

func ToHex(str string) string

func TrimFen

func TrimFen(fen string) string

Remove the last two fields in FEN string as they're not needed when checking for repetition

Types

This section is empty.

Jump to

Keyboard shortcuts

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