本文整理汇总了Python中pychess.Utils.lutils.LBoard.LBoard.iniAtomic方法的典型用法代码示例。如果您正苦于以下问题:Python LBoard.iniAtomic方法的具体用法?Python LBoard.iniAtomic怎么用?Python LBoard.iniAtomic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pychess.Utils.lutils.LBoard.LBoard
的用法示例。
在下文中一共展示了LBoard.iniAtomic方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: PyChessCECP
# 需要导入模块: from pychess.Utils.lutils.LBoard import LBoard [as 别名]
# 或者: from pychess.Utils.lutils.LBoard.LBoard import iniAtomic [as 别名]
#.........这里部分代码省略.........
elif lines[0] in ("accepted", "rejected"):
# We only really care about one case:
if tuple(lines) == ("rejected", "debug"):
self.debug = False
elif lines[0] == "new":
self.__stopSearching()
self.board = LBoard(NORMALCHESS)
self.board.applyFen(FEN_START)
self.forced = False
self.playingAs = BLACK
self.clock[:] = self.basetime, self.basetime
self.searchtime = 0
self.sd = MAXPLY
if self.analyzing:
self.__analyze()
elif lines[0] == "variant":
if len(lines) > 1:
if lines[1] == "fischerandom":
self.board.variant = FISCHERRANDOMCHESS
elif lines[1] == "crazyhouse":
self.board.variant = CRAZYHOUSECHESS
self.board.iniHouse()
elif lines[1] == "wildcastle":
self.board.variant = WILDCASTLESHUFFLECHESS
elif lines[1] == "losers":
self.board.variant = LOSERSCHESS
elif lines[1] == "suicide":
self.board.variant = SUICIDECHESS
elif lines[1] == "atomic":
self.board.variant = ATOMICCHESS
self.board.iniAtomic()
elif lines[0] == "quit":
self.forced = True
self.__stopSearching()
sys.exit(0)
elif lines[0] == "random":
leval.random = True
elif lines[0] == "force":
if not self.forced and not self.analyzing:
self.forced = True
self.__stopSearching()
elif lines[0] == "go":
self.playingAs = self.board.color
self.forced = False
self.__go()
elif lines[0] == "playother":
self.playingAs = 1-self.board.color
self.forced = False
# TODO: start pondering, if possible
elif lines[0] in ("black", "white"):
newColor = lines[0] == "black" and BLACK or WHITE
self.__stopSearching()
self.playingAs = 1-newColor
if self.board.color != newColor:
self.board.setColor(newColor)
self.board.setEnpassant(None)
if self.analyzing:
示例2: PyChessCECP
# 需要导入模块: from pychess.Utils.lutils.LBoard import LBoard [as 别名]
# 或者: from pychess.Utils.lutils.LBoard.LBoard import iniAtomic [as 别名]
#.........这里部分代码省略.........
if tuple(lines) == ("rejected", "debug"):
self.debug = False
elif lines[0] == "new":
self.__stopSearching()
self.board = LBoard(NORMALCHESS)
self.board.applyFen(FEN_START)
self.outOfBook = False
self.forced = False
self.playingAs = BLACK
self.clock[:] = self.basetime, self.basetime
self.searchtime = 0
self.sd = MAXPLY
if self.analyzing:
self.__analyze()
elif lines[0] == "variant":
if len(lines) > 1:
if lines[1] == "fischerandom":
self.board.variant = FISCHERRANDOMCHESS
elif lines[1] == "crazyhouse":
self.board.variant = CRAZYHOUSECHESS
self.board.iniHouse()
elif lines[1] == "wildcastle":
self.board.variant = WILDCASTLESHUFFLECHESS
elif lines[1] == "losers":
self.board.variant = LOSERSCHESS
elif lines[1] == "suicide":
self.board.variant = SUICIDECHESS
elif lines[1] == "giveaway":
self.board.variant = GIVEAWAYCHESS
elif lines[1] == "atomic":
self.board.variant = ATOMICCHESS
self.board.iniAtomic()
elif lines[1] == "3check":
self.board.variant = THREECHECKCHESS
elif lines[1] == "kingofthehill":
self.board.variant = KINGOFTHEHILLCHESS
self.print("setup (PNBRQKpnbrqk) 8x8+0_fairy %s" %
FEN_START)
elif lines[1] == "horde":
self.board = LBoard(HORDECHESS)
self.board.applyFen(HORDESTART)
elif lines[1] == "asean":
self.board = LBoard(ASEANCHESS)
self.board.applyFen(ASEANSTART)
elif lines[1] == "makruk":
self.board = LBoard(MAKRUKCHESS)
self.board.applyFen(MAKRUKSTART)
elif lines[1] == "cambodian":
self.board = LBoard(CAMBODIANCHESS)
self.board.applyFen(KAMBODIANSTART)
self.print(
"setup (PN.R.M....SKpn.r.m....sk) 8x8+0_makruk %s"
% KAMBODIANSTART)
self.print("piece K& KiN")
self.print("piece M& FifD")
elif lines[1] == "sittuyin":
self.board = LBoard(SITTUYINCHESS)
self.board.applyFen(SITTUYINSTART)
self.print(
"setup (PN.R.F....SKpn.r.f....sk) 8x8+6_bughouse %s"
% SITTUYINSTART)
self.print("piece N& [email protected]")
self.print("piece S& [email protected]")
self.print("piece F& [email protected]")