当前位置: 首页>>代码示例>>Python>>正文


Python Block.place方法代码示例

本文整理汇总了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]
开发者ID:mclumd,项目名称:erewhon_systems,代码行数:19,代码来源:top_level.py

示例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")
开发者ID:mclumd,项目名称:erewhon_systems,代码行数:19,代码来源:test.py

示例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")
开发者ID:mclumd,项目名称:erewhon_systems,代码行数:24,代码来源:test.py


注:本文中的block.Block.place方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。