當前位置: 首頁>>代碼示例>>Python>>正文


Python Board.move_algebraic方法代碼示例

本文整理匯總了Python中chess.board.Board.move_algebraic方法的典型用法代碼示例。如果您正苦於以下問題:Python Board.move_algebraic方法的具體用法?Python Board.move_algebraic怎麽用?Python Board.move_algebraic使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在chess.board.Board的用法示例。


在下文中一共展示了Board.move_algebraic方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Board

# 需要導入模塊: from chess.board import Board [as 別名]
# 或者: from chess.board.Board import move_algebraic [as 別名]
from py_uci import UCIEngine
from chess.board import Board

b = Board()
b.move_algebraic("e4")
b.move_algebraic("c5")
b.move_algebraic("Nf3")
b.move_algebraic("d6")
b.move_algebraic("d4")
b.move_algebraic("cxd4")
b.move_algebraic("Nxd4")
b.move_algebraic("Nf6")
b.move_algebraic("Nc3")
b.move_algebraic("a6")
b.move_algebraic("g4")

e = UCIEngine(multi_pv=10)
e.new_game()
e.set_position(moves=b.get_moves())
e.find_best_move(10000)
print b
開發者ID:certik,項目名稱:chess,代碼行數:23,代碼來源:analyse_opening.py

示例2: Board

# 需要導入模塊: from chess.board import Board [as 別名]
# 或者: from chess.board.Board import move_algebraic [as 別名]
import sys
sys.path.append("..")
from py_uci import UCIEngine
from chess.board import Board

b = Board()
b.move_algebraic("e4")
b.move_algebraic("e5")
b.move_algebraic("Nf3")
b.move_algebraic("Nc6")
b.move_algebraic("Bc4")
b.move_algebraic("h6")
b.move_algebraic("O-O")
b.move_algebraic("Bc5")
b.move_algebraic("c3")
b.move_algebraic("Nf6")
b.move_algebraic("d4")
b.move_algebraic("exd4")
b.move_algebraic("cxd4")
b.move_algebraic("Bb6")
b.move_algebraic("e5")
b.move_algebraic("Nh7")
b.move_algebraic("d5")
b.move_algebraic("Ne7")
b.move_algebraic("d6")
b.move_algebraic("Nc6")

#b.move_algebraic("Bxf7")
#b.move_algebraic("Kxf7")
#b.move_algebraic("dxc7")
#b.move_algebraic("Qxc7")
開發者ID:certik,項目名稱:chess,代碼行數:33,代碼來源:ex1.py


注:本文中的chess.board.Board.move_algebraic方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。