コード例 #1
0
        S["id_to_obj"] = {}
        for m in S["mobs"]:
            S["id_to_obj"][m["dict_id"]] = m
        for m in S["block_obj"]:
            S["id_to_obj"][m["dict_id"]] = m
        if flat:
            for b in S["block_obj"]:
                if b["blocks"] is not None:
                    b["blocks"] = get_slice(b["blocks"], axis=1, coord=0)

    return S


if __name__ == "__main__":

    template_attributes = {"count": range(1, 5)}
    template_attributes["step"] = range(1, 10)
    template_attributes["non_shape_names"] = list(SPECIAL_SHAPES_CANONICALIZE.keys())
    template_attributes["mob_names"] = ["pig", "sheep", "cow", "chicken", "rabbit"]

    for i in range(1000):
        print(i)
        S = build_scene(template_attributes)


# import json
# x = {'a':{'at':'d', 'R':{'hs':'h', 'ha':'h', 'l':{'rd':'right', 'lt':'RO','R':{'hn':'donk'}}}}}
# print(json.dumps(x, sort_keys=True, indent=4))
# u = get_fields_by_key((None, x) , 'R')
# print(len(u))
コード例 #2
0
            S["id_to_obj"][m["dict_id"]] = m
        for m in S["block_obj"]:
            S["id_to_obj"][m["dict_id"]] = m
        if flat:
            for b in S["block_obj"]:
                if b["blocks"] is not None:
                    b["blocks"] = get_slice(b["blocks"], axis=1, coord=0)

    return S


if __name__ == "__main__":

    template_attributes = {"count": range(1, 5)}
    template_attributes["step"] = range(1, 10)
    template_attributes["non_shape_names"] = list(
        SPECIAL_SHAPES_CANONICALIZE.keys())
    template_attributes["mob_names"] = [
        "pig", "sheep", "cow", "chicken", "rabbit"
    ]

    for i in range(1000):
        print(i)
        S = build_scene(template_attributes)

# import json
# x = {'a':{'at':'d', 'R':{'hs':'h', 'ha':'h', 'l':{'rd':'right', 'lt':'RO','R':{'hn':'donk'}}}}}
# print(json.dumps(x, sort_keys=True, indent=4))
# u = get_fields_by_key((None, x) , 'R')
# print(len(u))