gochess

package
v0.0.0-...-b5c7783 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2017 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PointStateBlank int = iota
	PointStateWhite
	PointStateBlack
)

PointState is

View Source
const (
	Level18K int = -18
	Level1D  int = 0
	Level2D  int = 1
	Level3D  int = 2
)

Level

View Source
const DefaultChessboardSize int = 19

DefaultChessboardSize is

Variables

This section is empty.

Functions

func Lazi

func Lazi(chessManual *ChessManual, dropPoint DropPoint) *[]DropPoint

Lazi is

Types

type ChessManual

type ChessManual struct {
	*Chessboard
	Players    [2]*Player // Player 0 using Black, Player 1 using White
	StartFlag  int        // "rang zi", if has 9 "rang zi" StartFlag is set to 9
	Komi       float32    // 5 Komi and a half
	DropPoints []DropPoint
	Ko         DropPoint
	Koflag     bool
}

ChessManual is

func NewDefaultChessManual

func NewDefaultChessManual() *ChessManual

NewDefaultChessManual is

func (*ChessManual) CheckFowardPoint

func (c *ChessManual) CheckFowardPoint(dropPoint DropPoint) bool

CheckFowardPoint is

func (*ChessManual) CheckFowardPoint1

func (c *ChessManual) CheckFowardPoint1(dropPoint DropPoint) bool

CheckFowardPoint1 two continuation drop must different

func (*ChessManual) CheckKoPoint

func (c *ChessManual) CheckKoPoint(dropPoint DropPoint) bool

CheckKoPoint is

type Chessboard

type Chessboard struct {
	Points [DefaultChessboardSize][DefaultChessboardSize]int
	Size   int // default is 19*19
}

Chessboard is

func (*Chessboard) CountQi

func (c *Chessboard) CountQi(dropPoint DropPoint) int

CountQi is

func (*Chessboard) GetDiffPoint

func (c *Chessboard) GetDiffPoint(dropPoint DropPoint) []DropPoint

GetDiffPoint is

func (*Chessboard) GetPointState

func (c *Chessboard) GetPointState(x, y int) (bool, int)

GetPointState is

func (*Chessboard) SetState

func (c *Chessboard) SetState(dropPoint DropPoint) bool

SetState is

type DropPoint

type DropPoint struct {
	State   int //may be white or black, if player pass, it blank
	X       int
	Y       int
	Comment string
}

DropPoint is

func IsDead

func IsDead(chessboard *Chessboard, dropPoint DropPoint) (bool, []DropPoint)

IsDead is

type Player

type Player struct {
	Name    string
	Level   int
	Comment string
}

Player is

Jump to

Keyboard shortcuts

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