當前位置: 首頁>>代碼示例>>Python>>正文


Python Darwin.left方法代碼示例

本文整理匯總了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")
開發者ID:ibrahimnagib,項目名稱:Darwins-World,代碼行數:11,代碼來源:TestDarwin.py

示例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")
開發者ID:ibrahimnagib,項目名稱:Darwins-World,代碼行數:11,代碼來源:TestDarwin.py

示例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")
開發者ID:ibrahimnagib,項目名稱:Darwins-World,代碼行數:17,代碼來源:TestDarwin.py


注:本文中的Darwin.Darwin.left方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。