本文整理汇总了Python中pychess.Utils.Board.Board.shuffle_start方法的典型用法代码示例。如果您正苦于以下问题:Python Board.shuffle_start方法的具体用法?Python Board.shuffle_start怎么用?Python Board.shuffle_start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pychess.Utils.Board.Board
的用法示例。
在下文中一共展示了Board.shuffle_start方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: shuffle_start
# 需要导入模块: from pychess.Utils.Board import Board [as 别名]
# 或者: from pychess.Utils.Board.Board import shuffle_start [as 别名]
Board.__init__(self, setup=self.shuffle_start())
else:
Board.__init__(self, setup=setup)
def shuffle_start(self):
tmp = ['r', 'n', 'b', 'q', 'k', 'b', 'n', 'r']
random.shuffle(tmp)
tmp = ''.join(tmp)
tmp = tmp + '/pppppppp/8/8/8/8/PPPPPPPP/' + tmp.upper() + ' w - - 0 1'
return tmp
class ShuffleChess:
__desc__ = _("xboard nocastle: http://tim-mann.org/xboard/engine-intf.html#8\n" +
"FICS wild/2: http://www.freechess.org/Help/HelpFiles/wild.html\n" +
"* Random arrangement of the pieces behind the pawns\n" +
"* No castling\n" +
"* Black's arrangement mirrors white's")
name = _("Shuffle")
cecp_name = "nocastle"
board = ShuffleBoard
need_initial_board = True
standard_rules = True
variant_group = VARIANTS_SHUFFLE
if __name__ == '__main__':
Board = ShuffleBoard(True)
for i in range(10):
print Board.shuffle_start()
示例2: shuffle_start
# 需要导入模块: from pychess.Utils.Board import Board [as 别名]
# 或者: from pychess.Utils.Board.Board import shuffle_start [as 别名]
Board.__init__(self, setup=self.shuffle_start(), lboard=lboard)
else:
Board.__init__(self, setup=setup, lboard=lboard)
def shuffle_start(self):
tmp = ['r', 'n', 'b', 'q', 'k', 'b', 'n', 'r']
random.shuffle(tmp)
tmp = ''.join(tmp)
tmp = tmp + '/pppppppp/8/8/8/8/PPPPPPPP/' + tmp.upper() + ' w - - 0 1'
return tmp
class ShuffleChess:
__desc__ = _("xboard nocastle: http://home.hccnet.nl/h.g.muller/engine-intf.html#8\n" +
"FICS wild/2: http://www.freechess.org/Help/HelpFiles/wild.html\n" +
"* Random arrangement of the pieces behind the pawns\n" +
"* No castling\n" +
"* Black's arrangement mirrors white's")
name = _("Shuffle")
cecp_name = "nocastle"
board = ShuffleBoard
need_initial_board = True
standard_rules = True
variant_group = VARIANTS_SHUFFLE
if __name__ == '__main__':
Board = ShuffleBoard(True)
for i in range(10):
print(Board.shuffle_start())