take5

package
v0.0.0-...-f2ec8e9 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: MIT Imports: 10 Imported by: 0

README

take5

ランダムムーブしたいなあ(^~^)
Move型を uint にしたぜ(^~^)
Undo したいよな(^~^) 取った駒を覚えておく必要があるんだぜ(^~^)

Documentation

Index

Constants

View Source
const (
	// 持ち駒を打つ 100~113
	// 先手飛打
	DROP_R1 = iota + 100
	DROP_B1
	DROP_G1
	DROP_S1
	DROP_N1
	DROP_L1
	DROP_P1
	DROP_R2
	DROP_B2
	DROP_G2
	DROP_S2
	DROP_N2
	DROP_L2
	DROP_P2
	DROP_ORIGIN = DROP_R1
)
View Source
const (
	// 先手
	FIRST = iota + 1
	// 後手
	SECOND
)
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_PG1   = "+G"
	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_PG2   = "+g"
	PIECE_PS2   = "+s"
	PIECE_PN2   = "+n"
	PIECE_PL2   = "+l"
	PIECE_PP2   = "+p"
)

View Source
const (
	// Author - 囲碁思考エンジンの作者名だぜ☆(^~^)
	Author = "Satoshi Takahashi"
)
View Source
const MOVES_SIZE = 512

電竜戦が一番長いだろ(^~^)

Variables

This section is empty.

Functions

func MainLoop

func MainLoop()

MainLoop - 開始。

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 NewMoveValue

func NewMoveValue() Move

func ParseMove

func ParseMove(command string, i *int, phase int) (Move, error)

ParseMove

func (Move) GetDestination

func (move Move) GetDestination() byte

GetDestination - 移動元マス

func (Move) GetPromotion

func (move Move) GetPromotion() byte

GetPromotion - 成

func (Move) GetSource

func (move Move) GetSource() byte

GetSource - 移動元マス

func (Move) ReplaceDestination

func (move Move) ReplaceDestination(sq uint32) Move

ReplaceDestination - 移動先マス

func (Move) ReplacePromotion

func (move Move) ReplacePromotion(promotion bool) Move

ReplacePromotion - 成

func (Move) ReplaceSource

func (move Move) ReplaceSource(sq uint32) Move

ReplaceSource - 移動元マス

func (Move) ToCode

func (move Move) ToCode() string

ToCode - SFEN の moves の後に続く指し手に使える文字列を返します

type Position

type Position struct {
	// Go言語で列挙型めんどくさいんで文字列で(^~^)
	// [19] は 1九、 [91] は 9一(^~^)反時計回りに90°回転した将棋盤の状態で入ってるぜ(^~^)想像しろだぜ(^~^)
	Board []string
	// 持ち駒の数だぜ(^~^) R, B, G, S, N, L, P, r, b, g, s, n, l, p
	Hands []int
	// 先手が1、後手が2(^~^)
	Phase int
	// 開始局面の時点で何手目か(^~^)これは表示のための飾りのようなものだぜ(^~^)
	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) DoMove

func (pos *Position) DoMove(move Move)

DoMove - 一手指すぜ(^~^)

func (*Position) ReadPosition

func (pos *Position) ReadPosition(command string)

ReadPosition - 局面を読み取ります。マルチバイト文字は含まれていないぜ(^q^)

func (*Position) ResetToStartpos

func (pos *Position) ResetToStartpos()

ResetToStartpos - 初期局面にします。

func (*Position) Sprint

func (pos *Position) Sprint() string

Print - 局面出力(^q^)

func (*Position) UndoMove

func (pos *Position) UndoMove()

UndoMove - 棋譜を頼りに1手戻すぜ(^~^)

type Profile

type Profile struct {
	Name   string
	Author string
}

Profile - Profile 区画。

type Variables

type Variables struct {
	// Log - ロガー。
	Log l.Logger
	// Chat - チャッター。 標準出力とロガーを一緒にしただけです。
	Chat l.Chatter
	// StderrChat - チャッター。 標準エラー出力とロガーを一緒にしただけです。
	StderrChat l.StderrChatter
}

Variables - グローバル変数。

var G Variables

G - グローバル変数。思い切った名前。

Jump to

Keyboard shortcuts

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