コード例 #1
0
def test_iterate_over_cells_and_neighbours():
    mesh = HexagonalMesh(1, 2, 2)
    for c_i in mesh.cells():
        print("I am cell #{}.".format(c_i))
        for c_j in mesh.neighbours[c_i]:
            print("\tAnd I am its neighbour, cell #{}!".format(c_j))
コード例 #2
0
def test_iterate_over_cells():
    mesh = HexagonalMesh(1, 2, 2)
    for c_i in mesh.cells():
        print("This is cell #{}, I have neighbours {}.".format(c_i, mesh.neighbours[c_i]))