本文整理汇总了Python中block.Block.place方法的典型用法代码示例。如果您正苦于以下问题:Python Block.place方法的具体用法?Python Block.place怎么用?Python Block.place使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类block.Block
的用法示例。
在下文中一共展示了Block.place方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createstartstate
# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import place [as 别名]
def createstartstate():
table = Block(Block.TABLE, "Table")
# make height 2 tower topped by triangle
t1 = Block(Block.SQUARE, 1)
t2 = Block(Block.SQUARE, 2)
t3 = Block(Block.TRIANGLE, 3)
# place single square on table
t4 = Block(Block.SQUARE, 4)
t1.place(table)
t2.place(t1)
t3.place(t2)
t4.place(table)
return [table, t1, t2, t3, t4]
示例2: test_001
# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import place [as 别名]
def test_001():
table = Block(Block.TABLE, 1)
# make height 3 tower topped by triangle
t1 = Block(Block.SQUARE, 2)
t2 = Block(Block.SQUARE, 3)
t3 = Block(Block.SQUARE, 4)
t4 = Block(Block.TRIANGLE, 5)
t1.place(table)
t2.place(t1)
t3.place(t2)
t4.place(t3)
# make problem file
gg = GoalGen20130330()
gg.makeshop2pfile([table, t1, t2, t3, t4], "problemfile_001")
示例3: test_002
# 需要导入模块: from block import Block [as 别名]
# 或者: from block.Block import place [as 别名]
def test_002():
table = Block(Block.TABLE, 1)
# make height 3 tower, not topped by triangle
t1 = Block(Block.SQUARE, 2)
t2 = Block(Block.SQUARE, 3)
t3 = Block(Block.SQUARE, 4)
t4 = Block(5, Block.TRIANGLE)
t1.place(table)
t2.place(t1)
t3.place(t2)
t4.place(table)
t1.isonfire = True
t3.isonfire = True
# make problem file
gg = GoalGen20130330()
gg.makeshop2pfile([table, t1, t2, t3, t4], "problemfile_002")