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