本文整理汇总了Python中Gui.drawStar方法的典型用法代码示例。如果您正苦于以下问题:Python Gui.drawStar方法的具体用法?Python Gui.drawStar怎么用?Python Gui.drawStar使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gui
的用法示例。
在下文中一共展示了Gui.drawStar方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: import Gui [as 别名]
# 或者: from Gui import drawStar [as 别名]
def main():
p1Gui = Gui("Player 1", 1)
p2Gui = Gui("Player 2", 2)
pos1 = getRandPos()
pos2 = getRandPos()
agent = Agent()
opAction = [0,0,0]
result2 = None
p1Gui.drawStar(pos1)
while True:
print(pos2)
type1, param1 = opponent(p1Gui, p2Gui)
result1 = executeHumanAction(p1Gui, p2Gui, type1, param1, pos1, pos2)
if type1 == move:
direction = p1Gui.getDirection(pos1, param1)
pos1 = param1
param1 = direction
p1Gui.clean()
p1Gui.drawStar(pos1)
opAction[0] = type1
opAction[1] = param1
opAction[2] = result1
type2, param2 = agent.play(2, result2, opAction, pos2)
result2 = executeCpuAction(p1Gui, type2, param2, pos2, pos1)
if type2 == move:
pos2 = param2