Documentation ¶
Index ¶
- Constants
- func MainLoop()
- type EngineConf
- type Move
- func (move Move) GetDestination() Square
- func (move Move) GetPromotion() bool
- func (move Move) GetSource() Square
- func (move Move) ReplaceDestination(sq Square) Move
- func (move Move) ReplacePromotion(promotion bool) Move
- func (move Move) ReplaceSource(sq Square) Move
- func (move Move) ToCode() string
- type Phase
- type PieceType
- type Position
- func (pPos *Position) AddControl(from Square, sign int8)
- func (pPos *Position) AddControlAllSlidingPiece(sign int8)
- func (pPos *Position) DoMove(move Move)
- func (pPos *Position) Hetero(to Square) bool
- func (pPos *Position) Homo(to Square) bool
- func (pPos *Position) IsEmptySq(sq Square) bool
- func (pPos *Position) ReadPosition(command string)
- func (pPos *Position) ResetToStartpos()
- func (pPos *Position) Sprint() string
- func (pPos *Position) SprintControl(phase Phase) string
- func (pPos *Position) UndoMove()
- type Profile
- type Square
- type Variables
Constants ¶
View Source
const ( // 持ち駒を打つ 100~113 // 先手飛打 DROP_R1 = Square(100) DROP_B1 = Square(101) DROP_G1 = Square(102) DROP_S1 = Square(103) DROP_N1 = Square(104) DROP_L1 = Square(105) DROP_P1 = Square(106) DROP_R2 = Square(107) DROP_B2 = Square(108) DROP_G2 = Square(109) DROP_S2 = Square(110) DROP_N2 = Square(111) DROP_L2 = Square(112) DROP_P2 = Square(113) DROP_ORIGIN = DROP_R1 DROP_TYPE_SIZE = DROP_P1 - DROP_ORIGIN )
View Source
const ( PIECE_TYPE_EMPTY = PieceType(0) // 空マス PIECE_TYPE_K = PieceType(1) PIECE_TYPE_R = PieceType(2) PIECE_TYPE_B = PieceType(3) PIECE_TYPE_G = PieceType(4) PIECE_TYPE_S = PieceType(5) PIECE_TYPE_N = PieceType(6) PIECE_TYPE_L = PieceType(7) PIECE_TYPE_P = PieceType(8) PIECE_TYPE_PR = PieceType(9) PIECE_TYPE_PB = PieceType(10) PIECE_TYPE_PS = PieceType(11) PIECE_TYPE_PN = PieceType(12) PIECE_TYPE_PL = PieceType(13) PIECE_TYPE_PP = PieceType(14) )
View Source
const ( // 空マス ZEROTH = Phase(0) // 先手 FIRST = Phase(1) // 後手 SECOND = Phase(2) )
View Source
const ( PIECE_EMPTY = "" PIECE_K1 = "K" PIECE_R1 = "R" PIECE_B1 = "B" PIECE_G1 = "G" PIECE_S1 = "S" PIECE_N1 = "N" PIECE_L1 = "L" PIECE_P1 = "P" PIECE_PR1 = "+R" PIECE_PB1 = "+B" PIECE_PS1 = "+S" PIECE_PN1 = "+N" PIECE_PL1 = "+L" PIECE_PP1 = "+P" PIECE_K2 = "k" PIECE_R2 = "r" PIECE_B2 = "b" PIECE_G2 = "g" PIECE_S2 = "s" PIECE_N2 = "n" PIECE_L2 = "l" PIECE_P2 = "p" PIECE_PR2 = "+r" PIECE_PB2 = "+b" PIECE_PS2 = "+s" PIECE_PN2 = "+n" PIECE_PL2 = "+l" PIECE_PP2 = "+p" )
駒
View Source
const (
// Author - 囲碁思考エンジンの作者名だぜ☆(^~^)
Author = "Satoshi Takahashi"
)
View Source
const BOARD_SIZE = 100
00~99
View Source
const MOVES_SIZE = 512
電竜戦が一番長いだろ(^~^)
View Source
const ResignMove = Move(0)
0 は 投了ということにするぜ(^~^)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EngineConf ¶
type EngineConf struct {
Profile Profile
}
EngineConf - Tomlファイル。
func LoadEngineConf ¶
func LoadEngineConf(path string) (*EngineConf, error)
LoadEngineConf - ゲーム設定ファイルを読み込みます。
type Move ¶
type Move uint32
Move - 指し手
17bit で表せるはず(^~^) pddddddddssssssss
1~8bit: 移動元 9~16bit: 移動先 17bit: 成
func GenMoveList ¶
GenMoveList - 現局面の指し手のリスト。合法手とは限らないし、全ての合法手を含むとも限らないぜ(^~^)
func NewMoveValue ¶
func NewMoveValue() Move
func NewMoveValue2 ¶
NewMoveValue2 - 初期値として 移動元マス、移動先マスを指定してください
func (Move) ReplaceDestination ¶
ReplaceDestination - 移動先マス
func (Move) ReplacePromotion ¶
ReplacePromotion - 成
type Position ¶
type Position struct { // Go言語で列挙型めんどくさいんで文字列で(^~^) // [19] は 1九、 [91] は 9一(^~^)反時計回りに90°回転した将棋盤の状態で入ってるぜ(^~^)想像しろだぜ(^~^) Board [BOARD_SIZE]string // 飛車の場所。長い利きを消すために必要(^~^) RookLocations [2]Square // 角の場所。長い利きを消すために必要(^~^) BishopLocations [2]Square // 香の場所。長い利きを消すために必要(^~^) LanceLocations [4]Square // 利きテーブル [0]先手 [1]後手 // マスへの利き数が入っています ControlBoards [2][BOARD_SIZE]int8 // 持ち駒の数だぜ(^~^) R, B, G, S, N, L, P, r, b, g, s, n, l, p Hands []int // 先手が1、後手が2(^~^) Phase Phase // 開始局面の時点で何手目か(^~^)これは表示のための飾りのようなものだぜ(^~^) StartMovesNum int // 開始局面から数えて何手目か(^~^)0から始まるぜ(^~^) OffsetMovesIndex int // 指し手のリスト(^~^) // 1手目は[0]へ、512手目は[511]へ入れろだぜ(^~^) Moves [MOVES_SIZE]Move // 取った駒のリスト(^~^)アンドゥ ムーブするときに使うだけ(^~^)指し手のリストと同じ添え字を使うぜ(^~^) CapturedList [MOVES_SIZE]string }
Position - 局面
func NewPosition ¶
func NewPosition() *Position
func (*Position) AddControl ¶
AddControl - 盤上のマスを指定することで、そこにある駒の利きを増減させます
func (*Position) AddControlAllSlidingPiece ¶
AddControlAllSlidingPiece - すべての長い利きの駒の利きを増減させます
func (*Position) ReadPosition ¶
ReadPosition - 局面を読み取ります。マルチバイト文字は含まれていないぜ(^q^)
func (*Position) ResetToStartpos ¶
func (pPos *Position) ResetToStartpos()
ResetToStartpos - 初期局面にします。
func (*Position) SprintControl ¶
Print - 利き数ボード出力(^q^)
Click to show internal directories.
Click to hide internal directories.