本文整理汇总了Python中chess.Board.parse_san方法的典型用法代码示例。如果您正苦于以下问题:Python Board.parse_san方法的具体用法?Python Board.parse_san怎么用?Python Board.parse_san使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chess.Board
的用法示例。
在下文中一共展示了Board.parse_san方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: parse_san
# 需要导入模块: from chess import Board [as 别名]
# 或者: from chess.Board import parse_san [as 别名]
def parse_san(self, board: chess.Board, san: str) -> chess.Move:
"""
When the visitor is used by a parser, this is called to parse a move
in standard algebraic notation.
You can override the default implementation to work around specific
quirks of your input format.
"""
# Replace zeros with correct castling notation.
if san == "0-0":
san = "O-O"
elif san == "0-0-0":
san = "O-O-O"
return board.parse_san(san)