isdead

package
v0.0.0-...-520dce3 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ABCDEFG = 0b11111110_11111110_11111110_11111110_11111110_11111110_11111110_11111110
	BCDEFGH = 0b01111111_01111111_01111111_01111111_01111111_01111111_01111111_01111111
	RANK_8  = 0b11111111_00000000_00000000_00000000_00000000_00000000_00000000_00000000
	RANK_1  = 0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_11111111

	A8 = 0b10000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000
	B8 = 0b01000000_00000000_00000000_00000000_00000000_00000000_00000000_00000000
	G8 = 0b00000010_00000000_00000000_00000000_00000000_00000000_00000000_00000000
	H8 = 0b00000001_00000000_00000000_00000000_00000000_00000000_00000000_00000000
	A7 = 0b00000000_10000000_00000000_00000000_00000000_00000000_00000000_00000000
	H7 = 0b00000000_00000001_00000000_00000000_00000000_00000000_00000000_00000000

	A1 = 0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_10000000
	B1 = 0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_01000000
	G1 = 0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000010
	H1 = 0b00000000_00000000_00000000_00000000_00000000_00000000_00000000_00000001
	A2 = 0b00000000_00000000_00000000_00000000_00000000_00000000_10000000_00000000
	H2 = 0b00000000_00000000_00000000_00000000_00000000_00000000_00000001_00000000
)

Variables

This section is empty.

Functions

func IsDead

func IsDead(s State) bool

Types

type Result

type Result struct {
	Dead       bool
	HasPawns   bool
	HasBishops bool
}

func IsDeadFen

func IsDeadFen(fen string) Result

type State

type State struct {
	WhiteKings, BlackKings     uint64
	WhitePawns, BlackPawns     uint64
	WhiteBishops, BlackBishops uint64
	Turn                       int // TODO use Turn
}

Jump to

Keyboard shortcuts

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