take5

package
v0.0.0-...-4b218a3 Latest Latest
Warning

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

Go to latest
Published: May 1, 2022 License: MIT Imports: 11 Imported by: 0

README

take5

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

Documentation

Index

Constants

View Source
const (
	// 先手
	FIRST = iota + 1
	// 後手
	SECOND
)

Variables

App - アプリケーション変数の宣言

Functions

func MainLoop

func MainLoop()

MainLoop - 開始。

func SprintBoard

func SprintBoard(pos *Position) string

Print - 局面出力(^q^)

Types

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 l03.Phase
	// 開始局面の時点で何手目か(^~^)これは表示のための飾りのようなものだぜ(^~^)
	StartMovesNum int
	// 開始局面から数えて何手目か(^~^)0から始まるぜ(^~^)
	OffsetMovesIndex int
	// 指し手のリスト(^~^)
	// 1手目は[0]へ、512手目は[511]へ入れろだぜ(^~^)
	Moves [l02.MOVES_SIZE]l03.Move
	// 取った駒のリスト(^~^)アンドゥ ムーブするときに使うだけ(^~^)指し手のリストと同じ添え字を使うぜ(^~^)
	CapturedList [l02.MOVES_SIZE]string
}

Position - 局面

func NewPosition

func NewPosition() *Position

func (*Position) DoMove

func (pos *Position) DoMove(move l03.Move)

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

func (*Position) GetPieceAtIndex

func (pPos *Position) GetPieceAtIndex(idx int) l03.Piece

func (*Position) GetPieceAtSq

func (pPos *Position) GetPieceAtSq(sq l03.Square) l03.Piece

func (*Position) ReadPosition

func (pos *Position) ReadPosition(command string)

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

func (*Position) ResetToStartpos

func (pos *Position) ResetToStartpos()

ResetToStartpos - 初期局面にします。

func (*Position) UndoMove

func (pos *Position) UndoMove()

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

Jump to

Keyboard shortcuts

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