def generate_triangular_board(edge=7, mirrored=False):
    """
    Creates a board with a shape of equilateral triangle.

    The size of the triangle's side (in fields) is specified by the edge argument.
    By default the resulting board will be a triangle pointing down (pointy top)
    of right (flat top). Setting mirrored to True changes this to a triangle
    pointing up or left, respectively.
    """
    def is_field(x, y): return x + y < edge if not mirrored else x + y + 1 >= edge
    board = [[int(is_field(x, y)) for y in range(edge)] for x in range(edge)]
    return board