本文整理汇总了Python中File.File.debug方法的典型用法代码示例。如果您正苦于以下问题:Python File.debug方法的具体用法?Python File.debug怎么用?Python File.debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类File.File
的用法示例。
在下文中一共展示了File.debug方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: interactive
# 需要导入模块: from File import File [as 别名]
# 或者: from File.File import debug [as 别名]
def interactive(ply):
g = Game()
mode, end = g.game_type()
end = int(end)
if mode: # mode is true means new game
player_x = Player("x")
player_y = Player("y")
b = Board(player_x, player_y)
ai = Ai(ply)
remain = ["PlayerX King", "PlayerX Rook", "PlayerY King"]
g.ask_piece(b, player_x, player_y, remain)
b.display()
File.prompt("Who am I, PlayerX or PlayerY?")
localPlayer = input("Player [x/y]: ")
if re.match(r"[Xx]", localPlayer):
localPlayer = "x"
else:
localPlayer = "y"
# if local player is playerX, PlayerX is our ai moves
# PlayerY is opponents moves inputted by us
if localPlayer == "x":
for i in range(0, end):
# b.ai_move(player_x)
ai.move(b, player_x)
b.display()
File.debug(ai.value(b))
File.debug(ai.number_of_states)
ai.opponent_move(player_y, b)
b.display()
else:
for i in range(0, end):
ai.opponent_move(player_x, b)
b.display()
# b.ai_move(player_y)
ai.move(b, player_y)
b.display()
File.debug(ai.value(b))
File.debug(ai.number_of_states)
else:
player_x = Player("x")
player_y = Player("y")
b = Board(player_x, player_y)
File.test_file(b, g, player_x, player_y)
ai = Ai(ply)
# AI random moves test:
for i in range(0, end):
ai.move(b, player_x)
b.display()
File.debug(ai.value(b))
File.debug(ai.number_of_states)
ai.move(b, player_y)
b.display()
File.debug(ai.value(b))
File.debug(ai.number_of_states)