本文整理汇总了Python中Darwin.Darwin.left方法的典型用法代码示例。如果您正苦于以下问题:Python Darwin.left方法的具体用法?Python Darwin.left怎么用?Python Darwin.left使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Darwin.Darwin
的用法示例。
在下文中一共展示了Darwin.left方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_Darwin_6
# 需要导入模块: from Darwin import Darwin [as 别名]
# 或者: from Darwin.Darwin import left [as 别名]
def test_Darwin_6(self):
# assert hasattr(Darwin, "place_creature")
game = Darwin(5,5)
food = Species("food")
b = Creature(food)
game.place_creature(b,2,2,"west")
self.assertEqual(b.direction,"west")
game.left(0,0)
self.assertEqual(b.direction,"south")
示例2: test_Darwin_7
# 需要导入模块: from Darwin import Darwin [as 别名]
# 或者: from Darwin.Darwin import left [as 别名]
def test_Darwin_7(self):
assert hasattr(Darwin, "show_board")
game = Darwin(5,5)
trap = Species("trap")
c = Creature(trap)
game.place_creature(c,2,2,"north")
self.assertEqual(c.direction,"north")
game.left(0,0)
self.assertEqual(c.direction,"west")
示例3: test_Darwin_4
# 需要导入模块: from Darwin import Darwin [as 别名]
# 或者: from Darwin.Darwin import left [as 别名]
def test_Darwin_4(self):
assert hasattr(Darwin, "right")
game = Darwin(5,5)
food = Species("food")
c = Creature(food)
game.place_creature(c,2,2,"east")
self.assertEqual(c.direction,"east")
game.left(0,0)
self.assertEqual(c.direction,"north")
game.left(0,0)
self.assertEqual(c.direction,"west")
game.left(0,0)
self.assertEqual(c.direction,"south")
game.left(0,0)
self.assertEqual(c.direction,"east")